login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A102832 Number of n-digit squares which contain the string "666" but not "6666". 0

%I #16 Mar 26 2021 15:00:28

%S 0,0,0,0,0,0,3,21,78,302,1139,4156,14791,52529,183565,635691,2183533,

%T 7314869,25303217

%N Number of n-digit squares which contain the string "666" but not "6666".

%t fQ[n_] := StringPosition[ ToString[n^2], "666"] != {} && StringPosition[ ToString[n^2], "6666"] == {}; t = Table[0, {20}]; Do[ If[ fQ[n], t[[ Ceiling[ Log[10, n^2]] + 1]]++ ], {n, 3162277661}]; t (* _Robert G. Wilson v_, Mar 10 2005 *)

%t t6[digs_]:=Module[{a=Floor[Sqrt[10^(digs-1)]],b=Floor[ Sqrt[ 10^digs]]},Count[ Range[a,b]^2,_?(SequenceCount[IntegerDigits[#],{6,6,6}]> 0&&SequenceCount[IntegerDigits[#],{6,6,6,6}]==0&)]]; Table[ t6[n],{n,20}] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Mar 26 2021 *)

%Y Cf. A052041, A075415, A102807 A032746.

%K nonn,base

%O 1,7

%A _James R. Buddenhagen_, Feb 27 2005

%E a(13)-a(19) from _Robert G. Wilson v_, Mar 03 2005

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 01:35 EDT 2024. Contains 371964 sequences. (Running on oeis4.)