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.

A195335 a(n) is the smallest Xmas tree prime with a(n-1) as a prefix (starting with 2).

This page as a plain text file.
%I A195335 #34 Jun 05 2025 13:47:15
%S A195335 2,211,211151,2111511013,211151101310867,211151101310867100673,
%T A195335 2111511013108671006731000357,211151101310867100673100035710000931,
%U A195335 211151101310867100673100035710000931100000213,2111511013108671006731000357100009311000002131000000901,211151101310867100673100035710000931100000213100000090110000001797
%N A195335 a(n) is the smallest Xmas tree prime with a(n-1) as a prefix (starting with 2).
%C A195335 A Xmas tree prime is a prime which is a concatenation of a prime with a single digit, a prime with two digits, a prime with three digits, a prime with four digits etc. By definition, the number of digits is a triangular number (A000217). Leading zeros are not allowed for any of the primes.
%H A195335 Terry Trotter, <a href="https://web.archive.org/web/20160629211025/http://trottermath.net/numtrivia/potpourri.html">Xmas tree primes</a>
%p A195335 read("transforms") ;
%p A195335 A195335 := proc(n)
%p A195335         option remember;
%p A195335         local prev,nxt,a ;
%p A195335         if n =1 then
%p A195335                 2;
%p A195335         else
%p A195335                 prev := procname(n-1) ;
%p A195335                 for nxt from 10^(n-1) to 10^n-1 do
%p A195335                         if isprime(nxt) then
%p A195335                                 a := digcat2(prev,nxt) ;
%p A195335                                 if isprime(a) then
%p A195335                                         return a ;
%p A195335                                 end if;
%p A195335                         end if;
%p A195335                 end do:
%p A195335                 return -1 ;
%p A195335         end if;
%p A195335 end proc: # _R. J. Mathar_, Sep 20 2011
%o A195335 (Python)
%o A195335 from sympy import isprime, nextprime
%o A195335 def alst(nn):
%o A195335   alst, astr = [2], "2"
%o A195335   for n in range(2, nn+1):
%o A195335     p = nextprime(10**(n-1))
%o A195335     while not isprime(int(astr + str(p))): p = nextprime(p)
%o A195335     alst.append(int(astr + str(p))); astr += str(p)
%o A195335   return alst
%o A195335 print(alst(11)) # _Michael S. Branicky_, Dec 26 2020
%Y A195335 Cf. A000217.
%K A195335 nonn,base
%O A195335 1,1
%A A195335 _Kausthub Gudipati_, Sep 16 2011
%E A195335 Name corrected by _Michael S. Branicky_, Dec 26 2020