cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

This page as a plain text file.
%I A102832 #16 Mar 26 2021 15:00:28
%S A102832 0,0,0,0,0,0,3,21,78,302,1139,4156,14791,52529,183565,635691,2183533,
%T A102832 7314869,25303217
%N A102832 Number of n-digit squares which contain the string "666" but not "6666".
%t A102832 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 A102832 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 A102832 Cf. A052041, A075415, A102807 A032746.
%K A102832 nonn,base
%O A102832 1,7
%A A102832 _James R. Buddenhagen_, Feb 27 2005
%E A102832 a(13)-a(19) from _Robert G. Wilson v_, Mar 03 2005