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!)
A339978 a(n) is the largest prime whose decimal expansion consists of the concatenation of a 1-digit square, a 2-digit square, a 3-digit square, ..., and an n-digit square, or 0 if there is no such prime. 9
0, 449, 981961, 9819619801, 981961980196721, 981961980199856194481, 9819619801998569980018946081, 981961980199856998001999824499740169, 981961980199856998001999824499980001989039601, 9819619801998569980019998244999800019999508849977812321 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
If a(n) exists it has A000217(n)= n*(n+1)/2 digits.
All the terms end with 1 or 9.
LINKS
David A. Corneth, Table of n, a(n) for n = 1..40 (first 16 terms from Michael S. Branicky)
EXAMPLE
a(1) = 0 because no 1-digit square {0, 1, 4, 9} is prime.
a(2) = 449 because 464, 481, 916, 925, 936, 949, 964, and 981 are not primes and 449, concatenation of 4 = 2^2 with 49 = 7^2, is prime.
a(4) = 9819619801, which is a prime is the concatenation of 9 = 3^2 with 81 = 9^2, then 961 = 31^2 and 9801 = 99^2. Observation, 9, 81, 961 and 9801 are the largest squares with respectively 1, 2, 3 and 4 digits.
PROG
(Python)
from sympy import isprime
from itertools import product
def a(n):
squares = [str(k*k) for k in range(1, int((10**n)**.5)+2)]
revsqrs = [[kk for kk in squares if len(kk)==i+1][::-1] for i in range(n)]
for t in product(*revsqrs):
intt = int("".join(t))
if isprime(intt): return intt
return 0
print([a(n) for n in range(1, 11)]) # Michael S. Branicky, Dec 25 2020
CROSSREFS
Cf. A000290, A003618, A061433 (largest squares), A338968 (concatenate primes).
Sequence in context: A012169 A093402 A012062 * A351947 A079659 A304511
KEYWORD
nonn,base
AUTHOR
Bernard Schott, Dec 25 2020
EXTENSIONS
a(5)-a(10) from Michael S. Branicky, Dec 25 2020
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 April 30 18:46 EDT 2024. Contains 372141 sequences. (Running on oeis4.)