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.

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.

This page as a plain text file.
%I A339978 #28 Dec 30 2020 07:46:55
%S A339978 0,449,981961,9819619801,981961980196721,981961980199856194481,
%T A339978 9819619801998569980018946081,981961980199856998001999824499740169,
%U A339978 981961980199856998001999824499980001989039601,9819619801998569980019998244999800019999508849977812321
%N 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.
%C A339978 If a(n) exists it has A000217(n)= n*(n+1)/2 digits.
%C A339978 All the terms end with 1 or 9.
%H A339978 David A. Corneth, <a href="/A339978/b339978.txt">Table of n, a(n) for n = 1..40</a> (first 16 terms from Michael S. Branicky)
%e A339978 a(1) = 0 because no 1-digit square {0, 1, 4, 9} is prime.
%e A339978 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.
%e A339978 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.
%o A339978 (Python)
%o A339978 from sympy import isprime
%o A339978 from itertools import product
%o A339978 def a(n):
%o A339978   squares = [str(k*k) for k in range(1, int((10**n)**.5)+2)]
%o A339978   revsqrs = [[kk for kk in squares if len(kk)==i+1][::-1] for i in range(n)]
%o A339978   for t in product(*revsqrs):
%o A339978     intt = int("".join(t))
%o A339978     if isprime(intt): return intt
%o A339978   return 0
%o A339978 print([a(n) for n in range(1, 11)]) # _Michael S. Branicky_, Dec 25 2020
%Y A339978 Cf. A000290, A003618, A061433 (largest squares), A338968 (concatenate primes).
%K A339978 nonn,base
%O A339978 1,2
%A A339978 _Bernard Schott_, Dec 25 2020
%E A339978 a(5)-a(10) from _Michael S. Branicky_, Dec 25 2020