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.

A340115 Largest prime whose decimal expansion consists of the concatenation of a 1-digit cube, a 2-digit cube, a 3-digit cube, ..., and an n-digit cube, or 0 if there is no such prime.

This page as a plain text file.
%I A340115 #25 Dec 31 2020 16:33:29
%S A340115 0,827,164729,8642164913,864729685979507,864729926197336531441,
%T A340115 8647299261973369702994826809,864729926197336970299980034443986977,
%U A340115 864729926197336970299993837599897344909853209,8647299261973369702999938375998973449970029998036054027
%N A340115 Largest prime whose decimal expansion consists of the concatenation of a 1-digit cube, a 2-digit cube, a 3-digit cube, ..., and an n-digit cube, or 0 if there is no such prime.
%C A340115 If a(n) exists it has A000217(n) = n*(n+1)/2 digits.
%C A340115 The similar smallest primes are in A215692.
%C A340115 We can conjecture that a(n) > 0 for all n > 1 and the terms converge to the concatenation of (c(1), c(2), c(3), ...) where c(k) is the largest k digit cube. The number of such primes between A215692(n) and a(n) is (0, 2, 2, 9, 177, 6909, 570166, ...). This is very close to what we expect given the number of concatenations of cubes of the respective length (product of 10^(k/3)-10^((k-1)/3), k=1..n) and the density of primes in that range according to the PNT. - _M. F. Hasler_, Dec 31 2020
%H A340115 M. F. Hasler, <a href="/A340115/b340115.txt">Table of n, a(n) for n = 1..44</a> (all terms < 10^1000), Dec 31 2020
%e A340115 a(1) = 0 because no 1-digit cube {0, 1, 8} is prime.
%e A340115 a(2) = 827 because 827 is prime and is the concatenation of 8 = 2^3 and 27 = 3^3.
%e A340115 a(3) = 164729 because 827343, 827729, 864343 and 864729 are not primes and 164729, concatenation of 1 = 1^3, 64 = 4^3 and 729 = 9^3 is prime.
%o A340115 (Python)
%o A340115 from sympy import isprime
%o A340115 from itertools import product
%o A340115 def a(n):
%o A340115   cubes = [str(k**3) for k in range(1, int((10**n)**(1/3))+2)]
%o A340115   revcbs = [[k3 for k3 in cubes if len(k3)==i+1][::-1] for i in range(n)]
%o A340115   for t in product(*revcbs):
%o A340115     intt = int("".join(t))
%o A340115     if isprime(intt): return intt
%o A340115   return 0
%o A340115 print([a(n) for n in range(1, 11)]) # _Michael S. Branicky_, Dec 28 2020
%o A340115 (PARI) A340115(n)=forvec(v=vector(n,k,-[sqrtnint(10^k-1,3),ceil(10^((k-1)/3))]),ispseudoprime(n=eval(concat([Str(-k^3)|k<-v])))&&return(n)) \\ _M. F. Hasler_, Dec 31 2020
%Y A340115 Cf. A000217, A000578, A003618, A061435.
%Y A340115 Cf. A338968 (with concatenated primes), A339978 (with concatenated squares).
%K A340115 nonn,base
%O A340115 1,2
%A A340115 _Bernard Schott_, Dec 28 2020
%E A340115 a(4)-a(10) from _Michael S. Branicky_, Dec 28 2020