How to resolve the algorithm Sequence of non-squares step by step in the Phixmonti programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Sequence of non-squares step by step in the Phixmonti programming language

Table of Contents

Problem Statement

Show that the following remarkable formula gives the sequence of non-square natural numbers:

This is sequence   A000037   in the OEIS database.

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Sequence of non-squares step by step in the Phixmonti programming language

Source code in the phixmonti programming language

include ..\Utilitys.pmt

def non-sq dup sqrt 0.5 + int + enddef

22 for dup print ", " print non-sq ? endfor

1000000 for
	non-sq sqrt dup int == if "Square found." ? exitfor endif
endfor

  

You may also check:How to resolve the algorithm Arrays step by step in the Forth programming language
You may also check:How to resolve the algorithm Disarium numbers step by step in the dc programming language
You may also check:How to resolve the algorithm Mutual recursion step by step in the BASIC programming language
You may also check:How to resolve the algorithm Sleep step by step in the Nim programming language
You may also check:How to resolve the algorithm Make directory path step by step in the Perl programming language