The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A154780 Numbers k with d digits such that all digits of k and the last d+1 digits of k^2 are prime. 1
5, 35, 235, 335, 2335, 3335, 23335, 32335, 33335, 72335, 233335, 323335, 333335, 372335, 572335, 723335, 2333335, 2372335, 2723335, 3233335, 3323335, 3333335, 3572335, 3723335, 7233335, 7323335, 7372335, 7572335, 22372335, 23333335 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Any term with d digits is the concatenation of a prime digit and an earlier term (with d-1 digits).
The sequence is infinite since it contains subsequences b(n) = (10^n-1)/3+2 = (5,35,335,3335,...), c(n) = 23*10^n+b(n) = (235,2335,23335,...), d(n) = 3233*10^n+b(n), e(n) = 7233*10^n+b(n) etc.
LINKS
FORMULA
For all n, a(n) == (5 mod 10).
For a(n) > 5, a(n) == 35 (mod 100).
For a(n) > 35, a(n) == 235 or 335 (mod 1000).
For a(n) > 335, a(n) == 2335 or 3335 (mod 10^4).
MATHEMATICA
Select[Range[5, 24000000, 5], And@@PrimeQ[IntegerDigits[#]]&& And@@ PrimeQ[ Take[ IntegerDigits[#^2], -(IntegerLength[#]+1)]]&] (* Harvey P. Dale, Dec 31 2012 *)
PROG
(PARI) last=[0]; {for( d=1, 8, new=[]; forprime( p=0, 9, for( k=1, #last, is_A046034((p*10^(d-1)+last[k])^2%10^(d+1)+20*10^d) & new=concat( new, p*10^(d-1)+last[k]))); print1(last=new, ", "))} /* for slightly more efficient code see A154779 */
CROSSREFS
Subsequence of A046034; contains A153025 as a subsequence.
Sequence in context: A002074 A187444 A166176 * A007995 A091928 A305739
KEYWORD
base,easy,nice,nonn
AUTHOR
M. F. Hasler, Jan 23 2009
STATUS
approved

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 May 13 11:43 EDT 2024. Contains 372504 sequences. (Running on oeis4.)