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.

User: Tamas Sandor Nagy

Tamas Sandor Nagy's wiki page.

Tamas Sandor Nagy has authored 81 sequences. Here are the ten most recent ones:

A387287 Primes in the order of their first appearance among the factors of the averages of twin prime pairs.

Original entry on oeis.org

2, 3, 5, 7, 17, 23, 11, 19, 47, 13, 29, 103, 107, 137, 43, 59, 41, 71, 31, 67, 139, 283, 149, 313, 37, 347, 373, 397, 443, 113, 467, 271, 181, 281, 577, 593, 199, 157, 653, 131, 101, 89, 241, 83, 251, 379, 773, 787, 167, 109, 907, 163, 73, 1033, 53, 223, 1117
Offset: 1

Author

Tamas Sandor Nagy, Aug 25 2025

Keywords

Comments

Will every prime appear, so that this sequence is a permutation of the primes?
The answer is yes if A071256(n) exists for every n. - Robert Israel, Aug 25 2025

Examples

			a(1) = 2 because 2 appeared first as a prime factor of the average of a twin prime pair, namely of 4 = 2*2 = 2^2, the average of 3 and 5, the first twin prime pair.
a(2) = 3 because 3 appeared next as a prime factor of the average of a twin prime pair, here 6 = 2*3, of the twin primes 5 and 7.
a(3) = 5 because 5 appeared next as a prime factor of the average of a twin prime pair, this time of 30 = 2*3*5, between 29 and 30. The averages 12 and 18 are skipped as their factors, 2 and 3, already appeared.
a(5) = 17 following a(4) = 7, skipping the primes 11 and 13 in the order of appearances.
		

Programs

  • Maple
    P:= select(isprime, {seq(i,i=3..10^4,2)}):
    TPA:= map(`+`, P intersect map(`-`,P,2),1):
    TPA:= sort(convert(TPA,list)):
    R:= NULL: S:= {}:
    for t in TPA do
      V:= numtheory:-factorset(t) minus S;
      if nops(V) > 1 then printf("t = %d: %a\n",t,V) fi;
      R:= R, op(sort(convert(V,list)));
      S:= S union V;
    od:
    R; # Robert Israel, Aug 25 2025
  • Mathematica
    With[{m = Select[Prime[Range[1000]], PrimeQ[# + 2] &] + 1}, DeleteDuplicates[Flatten[FactorInteger[#][[;; , 1]] & /@ m]]] (* Amiram Eldar, Aug 25 2025 *)

A387095 a(1) = 1 for the single prime 3; for n>=2, a(n) is the number of primes between 2^n and 2^(n+1) whose pairs lay symmetrically at each side of the center 3*2^(n-1) of that interval.

Original entry on oeis.org

1, 2, 2, 4, 4, 6, 8, 22, 26, 42, 92, 128, 218, 416, 750, 1300, 2342, 4136, 7440, 13572, 24820, 45420, 82922, 152964, 282626, 522354, 972388, 1809744, 3379508, 6318652, 11855790, 22277960, 41917480
Offset: 1

Author

Tamas Sandor Nagy, Aug 16 2025

Keywords

Comments

These primes form the sequence A092570.
With a different approach by seeking symmetries in the distribution of primes, we arrive at the same sequence as A092570. Here, the numbers of primes that fit those symmetries in their ranges form this sequence. Those ranges, interestingly, lay between the powers of 2.
The sum of each prime pair in a range is 3*2^n. (Sequence A007283).
In rows 2, 3, and 7, the middle primes (5, 7), (11, 13) and (191, 193) respectively are just next to the centers of their ranges, and with gaps of size 2 in between them, they are twin prime pairs.
If it could be proved that a derived sequence, 0, 1, 1, 5, 5, 7, 1, ..., that is the distances of the closest primes to the centers 3*2^n of the ranges contains infinitely many 1's, which always correspond to twin primes, then that would also prove the infinitude of twin primes. Of that particular form, A181494 shows the only known eight primes.

Examples

			Intervals:                         Primes                       Centers       Count
                                in A092570:                  of intervals:    a(n):
  [2,4]                              3                             3            1
  [4,8]                           5     7                          6            2
  [8,16]                         11    13                         12            2
  [16,32]                  17    19    29    31                   24            4
  [32,64]                  37    43    53    59                   48            4
  [64,128]           79    83    89   103   109   113             96            6
  [128,256]   151   157   173   191   193   211   227   233      192            8
  ...
In row 5 for the interval 2^5 = 32 to 2^6 = 64, the prime pair 37 and 59 lay symmetrically to each side of the center of that interval, 3*2^4 = 48 as abs(48-37) = abs(48-59) = 11, and their sum 37 + 59 = 96, which is 3*2^5. So are 43 and 53 in similarly symmetrical positions in that range, with their sum being 96 also.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{c = 0, r = r1 = 3*2^(n-1)}, While[(r1 = NextPrime[r1, -1]) > 2^n, If[PrimeQ[2*r - r1], c += 2]]; c]; a[1] = 1; Array[a, 20] (* Amiram Eldar, Aug 16 2025 *)

Extensions

a(13)-a(33) from Amiram Eldar, Aug 16 2025

A386256 Smallest semiprime p1*p2 such that p2 mod p1 = n and no prime is used more than once in the sequence.

Original entry on oeis.org

6, 35, 377, 407, 817, 391, 3649, 3131, 4841, 4331, 11461, 5293, 7729, 8051, 12031, 25217, 34417, 29503, 24931, 33389, 26051, 57479, 78227, 44377, 68557, 15707, 78119, 64829, 197401, 77059, 166633, 71371, 140579, 86147, 96427, 109237, 84907, 142523, 213341, 158801
Offset: 1

Author

Tamas Sandor Nagy, Aug 14 2025

Keywords

Comments

Will every prime be used? If so, then the prime factors p1 and p2 of the terms, listed term by term, is a permutation of the primes.

Examples

			a(4) = 407 = 11 * 37 because 37 mod 11 = 4, and neither of these primes were used before in the sequence as a(1) = 2 * 3, a(2) = 5 * 7, and a(3) = 13 * 29, and so 11 and 37 are the earliest possible primes to satisfy the condition.
a(5) = 817 = 19 * 43 because 43 mod 19 = 5. Smaller candidate primes such as 13 and 31 would have been suitable, but 13 was already used for a(3) = 377 = 13 * 29. Therefore 19 and 43 are the earliest possible primes to satisfy the condition.
		

Crossrefs

Programs

  • Mathematica
    q[k_, n_, ps_] := Module[{f = FactorInteger[k], p1, p2}, If[f[[;; , 2]] != {1, 1}, {}, p1 = f[[1, 1]]; p2 = f[[2, 1]]; If[Mod[p2, p1] == n && ! MemberQ[ps, p1] && ! MemberQ[ps, p2], {p1, p2}, {}]]];
    seq[nmax_] := Module[{ps = {}, s = {}, k, p}, Do[k = 6; While[(p = q[k, n, ps]) == {}, k++]; AppendTo[s, Times @@ p]; ps = Join[ps, p], {n, 1, nmax}]; s]; seq[40] (* Amiram Eldar, Aug 14 2025 *)
    nsp[n_Integer] := nsp[n] = Block[{sp = n + 1}, While[ PrimeOmega[sp] != 2, sp++]; sp]; a[n_] := Block[{sp = 4}, While[fi = Flatten[ Table[ #[[1]], {#[[2]]}] & /@ FactorInteger[ sp]]; Mod[ fi[[2]], fi[[1]]] != n || MemberQ[p, fi[[1]]] ||  MemberQ[p, fi[[2]]], sp = nsp[sp]]; AppendTo[p, fi[[1]]]; AppendTo[p, fi[[2]]]; sp]; p = {}; Do[Print[{n, f[n]}], {n, 50}] (* Robert G. Wilson v, Aug 20 2025 *)

A386520 Column sums of the triangle in A386755.

Original entry on oeis.org

1, 5, 13, 13, 31, 35, 57, 61, 85, 85, 111, 99, 235, 89, 353, 173, 171, 341, 343, 229, 489, 423, 415, 435, 661, 525, 535, 559, 1161, 427, 931, 653, 1201, 787, 941, 885, 1629, 537, 1443, 1839, 1723, 931, 1119, 1525, 2415, 741, 2257, 2327, 1947, 2005, 2767, 1131, 3181, 1055, 3131, 2147
Offset: 1

Author

Tamas Sandor Nagy, Jul 24 2025

Keywords

Comments

It appears that A007952(n) is the index of the row where n first appears.
It appears that A007952(n)-1 is the index of the row where the last nonzero term of the n-th column is seen. - Michel Marcus, Aug 02 2025

Examples

			Triangle whose columns are summed.
  m/n| 1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20
  ----------------------------------------------------------------
   1 | 1
   2 |    1
   3 |    2  1
   4 |    2     1
   5 |       3  2  1
   6 |       3  2     1
   7 |       3        2  1
   8 |       3        2     1
   9 |          4     3     2  1
  10 |          4     3     2     1
  11 |             5        4  3  2  1
  12 |             5        4  3  2     1
  13 |             5        4  3        2  1
  14 |             5        4  3        2     1
  15 |             5        4           3     2  1
  16 |             5        4           3     2     1
  17 |                6           5     4        3  2  1
  18 |                6           5     4        3  2     1
  19 |                6           5     4        3        2  1
  20 |                6           5     4        3        2     1
  ...
The completed column for n=5 is definitely fully visible here because in column 6 for n=6 the divisor k=6 already appeared. That means that column 5 cannot have more divisors in it under the last k=5 in row 17 because in that row only k=7 may follow k=6 in theory, but 7 does not divide 5. So, all similarly proven, definitely fully visible completed columns in this sample array are readily summable by sight. E.g. column 5: a(5) = 1 + 5 + 5 + 5 + 5 + 5 + 5 = 31.
		

Crossrefs

Cf. A386755.
Cf. A007952 (row number where k=n first appears).

Programs

  • PARI
    \\ uses row(n) from A386755
    a(n) = my(ok=1, k=1, last=-1, s=0, r); while(ok, r=row(k); if (#r >= n, s+=r[n]); k++; if (#r>=n, if ((last==n) && (r[n]==0), ok = 0, last = r[n]))); s; \\ Michel Marcus, Aug 02 2025
    
  • PARI
    \\ uses row(n) from A386755
    lista(nn) = my(ok=1, k=1, vlast=vector(nn,i,-1), vs=vector(nn)); while(ok, my(r=row(k)); for (i=1, nn, if (#r>=i, vs[i]+=r[i])); k++; my(nbok=0); for (i=1, nn, if (#r>=i, if ((vlast[i]==i) && (r[i]==0), nbok++, vlast[i] = r[i]))); if (nbok == nn, ok = 0);); vs; \\ Michel Marcus, Aug 02 2025

A386755 Triangle read by rows, where row terms are filled depending on divisibility of n. See comments.

Original entry on oeis.org

1, 0, 1, 0, 2, 1, 0, 2, 0, 1, 0, 0, 3, 2, 1, 0, 0, 3, 2, 0, 1, 0, 0, 3, 0, 0, 2, 1, 0, 0, 3, 0, 0, 2, 0, 1, 0, 0, 0, 4, 0, 3, 0, 2, 1, 0, 0, 0, 4, 0, 3, 0, 2, 0, 1, 0, 0, 0, 0, 5, 0, 0, 4, 3, 2, 1, 0, 0, 0, 0, 5, 0, 0, 4, 3, 2, 0, 1, 0, 0, 0, 0, 5, 0, 0, 4, 3, 0, 0, 2, 1
Offset: 1

Author

Tamas Sandor Nagy, Aug 01 2025

Keywords

Comments

The construction of the array is as follows:
With divisibility testing steps of the process, we find the next strictly smaller multiple of k and enter that k in the row, one after the other.
In this process of row by row, we start at column number n that is the same as the row number. We always start with k=1 and then seek out those greatest m's that are lesser than the previous ones and which are divisible by the incremental k's, until a k exceeds the next m to be tested for divisibility. We write the divisors k inside the rows of the array, but leave 0 where k is not a divisor of n.
Notable properties of the array: Each column contains the proper divisors of n as well as n itself, with multiplicity.
The construction of row n is independent of any other row.
Another related sequence, A007952, is the row numbers where the first k=n's appear.
To construct row n we start by placing d=1 in column n. If we just placed d-1 in column j, then we next place d in the largest column k < j such that d | k. If there is no such column the process ends with d-1 as the largest number in the row. All unused columns are set to 0.

Examples

			The triangle begins:
  1;
  0, 1;
  0, 2, 1;
  0, 2, 0, 1;
  0, 0, 3, 2, 1;
  0, 0, 3, 2, 0, 1;
  0, 0, 3, 0, 0, 2, 1;
  0, 0, 3, 0, 0, 2, 0, 1;
  0, 0, 0, 4, 0, 3, 0, 2, 1;
  0, 0, 0, 4, 0, 3, 0, 2, 0, 1;
  ...
.
An example for the step by step construction of a particular row, let it be row n=20: We start with k=1 at column 20, and find that k=1 divides c=20. So we enter k=1 into the array in that column. Next, let now k=2, and we look for the greatest c that is less than 20, and which is divisible by k=2. That c is 18 in column 18, so we enter 2 in that column. We increase k by 1 to k=3, and similarly seek out the greatest c again that is less than 18, and which is divisible by 3. This number is 15, and so we enter 3 in column 15. And so on, we test divisibility with k=4, k=5, and k=6 to find that these k's fit under c=12, c=10 and c=6, respectively.
  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20
  0  0  0  0  0  6  0  0  0  5  0  4  0  0  3  0  0  2  0  1
		

Crossrefs

Programs

  • PARI
    row(n) = my(v=vector(n), m=n); for(k=1, n, my(keepm = m); while(m%k, m--); if (m == 0, keepm=m, v[m] = k; m--);); v; \\ Michel Marcus, Aug 01 2025

A386364 Irregular triangle read by rows. The prime numbers corresponding to the distinct prime chains in A385871. Also a permutation of the primes.

Original entry on oeis.org

2, 3, 7, 5, 11, 23, 13, 17, 19, 37, 29, 53, 31, 41, 73, 43, 47, 83, 137, 59, 61, 67, 71, 79, 131, 89, 97, 157, 101, 163, 103, 167, 107, 173, 109, 113, 127, 139, 149, 233, 353, 151, 179, 277, 181, 281, 421, 613, 191, 193, 197, 199, 211, 223, 337, 227, 229, 239, 241, 251, 257, 263, 269, 271
Offset: 1

Author

Tamas Sandor Nagy, Jul 19 2025

Keywords

Comments

See A385871 for the full definition for this sequence.
A permutation of the prime numbers.

Examples

			The irregular triangle begins:
  2,  3,  7;
  5, 11, 23;
 13;
 17;
 19, 37;
 29, 53;
 31;
 41, 73;
 ...
		

Crossrefs

Programs

  • PARI
    f(n) = my(m=1, x); while((x=(prime(n) + 2*(n - 1) + m - prime(n + m)))>= 0, if (x==0, return(m+n)); m++); \\ A385871
    lista(nn) = my(list = List(), vp=vector(nn)); for (n=1, nn, if (!vp[n], my(v=Vec(prime(n)), m=n); vp[n] = 1; while(m = f(m), v=concat(v, prime(m)); if (m<=nn, vp[m]=1)); listput(list, v););); Vec(list); \\ Michel Marcus, Jul 19 2025

Extensions

More terms from Michel Marcus, Jul 19 2025

A385871 a(n) is the number of primes in the prime chain to which prime(n) belongs. Details are in the Comments.

Original entry on oeis.org

3, 3, 3, 3, 3, 1, 1, 2, 3, 2, 1, 2, 2, 1, 3, 2, 1, 1, 1, 1, 2, 2, 3, 1, 2, 2, 2, 2, 1, 1, 1, 2, 3, 1, 3, 1, 2, 2, 2, 2, 2, 4, 1, 1, 1, 1, 1, 2, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 2, 4, 1, 1, 1, 3, 2, 1, 1, 2, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 2, 1, 1, 3, 2
Offset: 1

Author

Tamas Sandor Nagy, Jul 11 2025

Keywords

Comments

This sequence originates from a counting game, or process, along the sequence of prime numbers.
At a given prime, the next prime in its chain is determined as follows:
The primes are lined up, and we start counting incrementally at the prime with the value of that prime itself, walking step by step, back towards to the prime 2. At 2 we turn to forward direction without counting twice at 2, and carry on counting further. We pass our starting prime and from there on, we observe whether at some point the count will equal the prime at that count, or not.
If the count and its prime are equal, then that prime is the next in the chain; otherwise the starting prime has no next prime and its chain ends.
To put it more formally:
For prime(k), to find out whether a greater prime(k + m) is directly linked next to prime(k) in a chain, we test if the equation prime(k) + 2*(k - 1) + m = prime(k + m) is satisfied for some m integer > 0.
Each prime has at most 1 predecessor in this rule so that the steps make a chain.
If prime(n) does not chain to a next prime, and no preceding prime chains to it, then its chain consists of itself only and has length a(n) = 1.

Examples

			The counting walk from 5:
 2        3        5        7       11       13       17       19       23
 7   <-   6   <-   5
     ->   8   ->   9   ->  10   ->  11
                                     ^
                                     |
                                   Match
The counting walk from 11:
 2        3        5        7       11       13       17       19       23
15  <-   14   <-  13   <-  12  <-   11
    ->   16   ->  17   ->  18  ->   19   ->  20   ->  21   ->  22  ->   23
                                                                         ^
                                                                         |
                                                                       Match
Since 5 cannot be reached from any lesser prime, and no greater prime can be reached either from 23 by this method, 5, 11, and 23 belong to a common prime chain of length 3, allowing a(3), a(5), and a(9) terms the value of 3 each.
The counting walk from 13:
 2     3     5     7    11    13    17    19    23    29    31    37
18 <- 17 <- 16 <- 15 <- 14 <- 13
   -> 19 -> 20 -> 21 -> 22 -> 23 -> 24 -> 25 -> 26 -> 27 -> 28 -> 29
                                                      ^
                                                      |
                                                  No match
                                            as the faster growing
                                            prime sequence here already
                                            overtook the counting sequence
                                            without reaching equal values
                                            at any second point.
.
Therefore 13 forms a chain with one solitary link only, and so a(6) = 1.
.
In another example, the primes 2, 3, and 7 are in a prime chain of length 3 because
  2 = prime(1), so k = 1
and
  prime(1) + 2*(1 - 1) + m = prime(1 + m)
  2 + 2*0 + m = prime(1 + m)
  2 + m = prime(1 + m)
Solved for m by search: m = 1
and since
  2 + 1 = prime(1 + 1)
  3 = prime(2) -> so far, 3 is linked to 2 in a prime chain.
Furthermore:
  3 = prime(2), so let now k = 2
and
  prime(2) + 2*(2 - 1) + m = prime(2 + m)
  3 + 2*1 + m = prime(2 + m)
  5 + m = prime(2 + m)
Solved for m by search: m = 2
and since
  5 + 2 = prime(2 + 2)
  7 = prime(4) -> so far, 7 is linked to 2 and 3 in a prime chain.
Checking for further members to the 2-3-7 prime chain:
  prime(4) + 2*(4 - 1) + m = prime(4 + m)
  7 + 2*3 + m = prime(4 + m)
  7 + 6 + m = prime(4 + m)
  13 + m = prime(4 + m)
No such m > 0 is found, so m and prime(4 + m) cannot exist to satisfy the equation.
The 2-3-7 prime chain has no more members, therefore they form a chain of length 3, and so the terms a(1), a(2), and a(4) each equal to 3.
The prime chains to which the first few primes belong:
   2     {2, 3, 7},
   3     {2, 3, 7},
   5     {5, 11, 23},
   7     {2, 3, 7},
  11     {5, 11, 23},
  13     {13},
  17     {17},
  19     {19, 37},
  23     {5, 11, 23},
  29     {29, 53},
  31     {31},
  37     {19, 37},
  41     {41, 73},
  43     {43},
  47     {47, 83, 137},
  53     {29, 53},
  ...
		

Crossrefs

Cf. A000040.

Extensions

More terms from Michel Marcus, Jul 13 2025

A385615 Star numbers corresponding to the point numbers in A385330.

Original entry on oeis.org

1, 2, 2, 3, 2, 3, 3, 4, 2, 4, 3, 4, 2, 3, 4, 5, 3, 4, 2, 5, 4, 5, 3, 5, 4, 2, 3, 5, 6, 4, 5, 6, 3, 4, 6, 2, 5, 6, 4, 5, 3, 6, 5, 4, 6, 7, 2, 3, 5, 7, 6, 4, 7, 5, 6, 3, 7, 4, 6, 2, 5, 7, 6, 4, 7, 5, 3, 6, 7, 8, 5, 4, 6, 7, 2, 8, 3, 5, 8, 7, 6, 4, 8, 7, 5, 6, 8
Offset: 1

Author

Keywords

Comments

See A385330 for the full definition of this sequence.

Crossrefs

Cf. A385330.

A385330 The point numbers encountered by a rotating marker following the process described in the Comments.

Original entry on oeis.org

1, 1, 2, 1, 1, 2, 3, 1, 2, 2, 1, 3, 1, 2, 4, 1, 3, 1, 2, 2, 2, 3, 1, 4, 3, 1, 2, 5, 1, 4, 1, 2, 3, 1, 3, 2, 2, 4, 2, 3, 1, 5, 4, 3, 6, 1, 1, 2, 5, 2, 1, 4, 3, 1, 2, 3, 4, 1, 3, 2, 2, 5, 4, 2, 6, 3, 1, 5, 7, 1, 4, 3, 6, 1, 1, 2, 2, 5, 3, 2, 1, 4, 4, 3, 1, 2, 5
Offset: 1

Author

Tamas Sandor Nagy, Jun 25 2025

Keywords

Comments

A marker moves clockwise in a unit circle around the origin. On revolution k, the regular star with k points is laid down with points labeled (k,1), (k,2), ..., (k,k) at regular angles. As the marker rotates we output both the newly laid down points and any existing points the marker sweeps over. The first point of the k-th star is placed at an angle bisecting the last point of the previous star and the next point already laid down.
If a new point happens to coincide exactly with an existing point, then the existing label is replaced with the appropriate new label.
The process begins with the degenerate 1-star, laying down the label (1,1) at 0 degrees. Next, the 2-star is laid down, starting with label (2,1) at 180 degrees (180 degrees being considered the bisector of 0 and 360 degrees), then overwriting (1,1) with (2,2) at 0 degrees. Next, the 3-star is laid down, starting at 90 degrees (the bisecting angle of 0 and 180 degrees) with (3,1), followed by (3,2) at 90+360/3 degrees, and so on. See the illustration in the Links and the Example.
Informally, this sequence is reminiscent of a radar display sweeping round and round gradually identifying more and more targets.
Conjecture: The only time a label is replaced is laying down the second point of the 2-star which overwrites the first (and only point) from the 1-star.

Examples

			The sequence can be written as an irregular triangle, read by rows, with row n corresponding to laying down the n-star. The first few rows are (star-number, point-number):
   (1,1);
   (2,1), (2,2)*;
   (3,1), (2,1), (3,2), (3,3);
   (4,1), (2,2), (4,2), (3,1), (4,3), (2,1), (3,2), (4,4);
   (5,1), (3,3), (4,1), (2,2), (5,2), (4,2), (5,3), (3,1), (5,4), (4,3), (2,1), (3,2), (5,5);
   ...
   * The label (2,2) overwrites the (1,1) label (the only known occurrence of an overwrite).
		

Crossrefs

Cf. A385615.

Extensions

More terms from Sean A. Irvine, Jun 30 2025

A385404 Numbers that can be split into two at any place between their digits such that the resulting numbers are always a nonprime on the left and a prime on the right.

Original entry on oeis.org

12, 13, 15, 17, 42, 43, 45, 47, 62, 63, 65, 67, 82, 83, 85, 87, 92, 93, 95, 97, 123, 143, 147, 153, 167, 183, 423, 443, 447, 453, 467, 483, 497, 623, 637, 643, 647, 653, 667, 683, 697, 813, 817, 823, 843, 847, 853, 867, 873, 883, 913, 917, 923, 937, 943, 947, 953, 967, 983, 997
Offset: 1

Author

Tamas Sandor Nagy, Jun 27 2025

Keywords

Comments

As no leading zeros are allowed, all terms are zeroless.
From Michael S. Branicky, Jun 27 2025: (Start)
Finite since each term with first digit removed must be a member of A024785, which is finite.
Last term here is a(7407) = 6357686312646216567629137. (End)

Examples

			637 is a term because when it is split in two in all possible ways, it first results in 63, a nonprime, and 3, a prime. When split in the second and final possible way, it results in 6, a nonprime, and 37, a prime.
		

Crossrefs

Programs

  • Mathematica
    q[n_] := !MemberQ[IntegerDigits[n], 0] && AllTrue[Range[IntegerLength[n]-1], PrimeQ[QuotientRemainder[n, 10^#]] == {False, True} &]; Select[Range[10, 1000], q] (* Amiram Eldar, Jun 27 2025 *)
  • Python
    from sympy import isprime
    def ok(n): return '0' not in (s:=str(n)) and len(s) > 1 and all(not isprime(int(s[:i])) and isprime(int(s[i:])) for i in range(1, len(s)))
    print([k for k in range(1000) if ok(k)]) # Michael S. Branicky, Jun 27 2025
    
  • Python
    # uses import and function ok above
    from itertools import count, islice, product
    def agen():  # generator of terms
        tp = list("23579")  # set of left-truncatable primes
        for d in count(2):
            tpnew = []
            for f in "123456789":
                for e in tp:
                    if isprime(int(s:=f+e)):
                        tpnew.append(s)
                    if ok(t:=int(f+e)):
                        yield t
            tp = tpnew
            if len(tp) == 0:
                return
    afull = list(agen())
    print(afull[:60]) # Michael S. Branicky, Jun 27 2025