login
Squarefree numbers such that in decimal representation all their prefixes are also squarefree.
1

%I #8 Aug 23 2020 11:39:23

%S 1,2,3,5,6,7,10,11,13,14,15,17,19,21,22,23,26,29,30,31,33,34,35,37,38,

%T 39,51,53,55,57,58,59,61,62,65,66,67,69,70,71,73,74,77,78,79,101,102,

%U 103,105,106,107,109,110,111,113,114,115,118,119,130,131,133,134,137

%N Squarefree numbers such that in decimal representation all their prefixes are also squarefree.

%C m is a term iff A008966(floor(m/10^k))=1 for 0<=k<=A004216(n);

%C a(n)=A005117(n) for n<=26, but A005117(27)=41 is not a term, as 4=2^2 is not squarefree.

%H Harvey P. Dale, <a href="/A076786/b076786.txt">Table of n, a(n) for n = 1..1000</a>

%e 143=11*13 is a term, as also 14=2*7 and 1 are squarefree.

%t Select[Range[200],AllTrue[FromDigits/@Table[Take[IntegerDigits[#],{1,n}],{n,IntegerLength[#]}],SquareFreeQ]&] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Aug 23 2020 *)

%K nonn,base

%O 1,2

%A _Reinhard Zumkeller_, Nov 16 2002