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.

Showing 1-2 of 2 results.

A214280 Total number of primes which can be reached via Cunningham chains, starting with prime(n), not counting this starting prime.

Original entry on oeis.org

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

Views

Author

Alex Ratushnyak, Jul 09 2012

Keywords

Comments

Other definition: Count of the binary descendants of the n-th prime. Prime q is a binary descendant of prime p if 2*p-1 <= q <= 2*p+1.
a(n) is the total count of direct binary descendants of the n-th prime plus their binary descendants, and so on.
q=(p-1)*2 + b*2 + 1, where b is either 0 or 1. Thus if p>2 then in base 2: q is p with a digit inserted before the least significant digit.
It is conjectured there are arbitrarily big terms (see the MathWorld link).
If p==2 (mod 3), then only 2p+1 (==2 (mod 3) again) may be prime; 2p-1 will be divisible by 3. For p==1 (mod 3), only 2p-1 (==1 (mod 3) again) can be prime. Therefore, there can be no alternance in the +1/-1 choice (except for starting primes 2 and 3) when looking at all possible descendants. This leads to the formula by T. D. Noe. - M. F. Hasler, Jul 13 2012

Examples

			prime(3)=5 has one binary descendant 11, which has one b.d. 23, which has one b.d. 47. Because 47 has no binary descendants, a(3)=3.
prime(4)=7 has one binary descendant 13, which has no binary descendants, so a(4)=1.
As explained in the comment, for n>2 this equals the maximum length of either of the Cunningham chains, i.e., iterations of x->2x+1 resp. x->2x-1 before getting a composite. For prime(2)=3, the first map yields (3)->7->(15) and the second map yields (3)->5->(9), so there are 2 primes, but one has to add the a(4)+a(3)=3+1 descendants of these 2 primes, whence a(2)=2+4=6.
Starting with prime(1)=2, the "2x-1" map yields 3, to which one must add its a(2)=6 descendants. They already include the prime 5 = 2*2+1 and its descendants. Thus, a(1)=1+6=7.
		

Crossrefs

Cf. A000040.
Cf. A005383 - primes of the form prime*2-1.
Cf. A005385 - primes of the form prime*2+1.
Cf. A214342 - count of the decimal descendants.
Cf. A181697, A181715 (two kinds of Cunningham chains).

Programs

  • Mathematica
    des[n_] := {If[PrimeQ[2*n-1], s = AppendTo[s, 2*n-1]; des[2*n-1]]; If[PrimeQ[2*n+1], s = AppendTo[s, 2*n+1]; des[2*n+1]]}; Table[s = {}; des[Prime[n]]; Length[Union[s]], {n, 100}] (* T. D. Noe, Jul 11 2012 *)

Formula

a(n) = max(A181697(n), A181715(n)) - 1 for n > 2. - T. D. Noe, Jul 12 2012

A346979 Count of the prime decimal descendants of n.

Original entry on oeis.org

83, 63, 23, 22, 23, 11, 29, 23, 3, 4, 54, 1, 9, 14, 6, 7, 3, 4, 7, 40, 0, 4, 19, 15, 8, 7, 10, 14, 5, 6, 2, 7, 0, 16, 9, 11, 12, 13, 4, 1, 34, 1, 8, 14, 5, 1, 13, 5, 5, 16, 6, 0, 9, 0, 24, 4, 6, 19, 2, 9, 25, 16, 0, 7, 4, 4, 3, 11, 2, 7, 7, 4, 1, 15, 2, 8, 8
Offset: 0

Views

Author

Ya-Ping Lu, Aug 09 2021

Keywords

Comments

The number of direct decimal descendants (i.e., decimal children) of n is A038800(n). The number of prime decimal descendants of the n-th prime is A214342(p_n). a(n) is the number of prime decimal descendants of n, which include the prime decimal children of n, the prime decimal children of the prime decimal children of n, and so on.
a(0) = Sum_{m=1..4} (A214342(m) + 1); a(1) = Sum_{m=5..8} (A214342(m) + 1).
a(A032352(m)) = 0; a(A119289(m)) = 0.
A214342 is a subset, as A214342(m) = a(prime(m)).
Conjecture 1: a(n) <= 83. Conjecture 2: lim_{n->oo} (n0/n) = 1, where n0 is the number of zero terms, a(k) = 0, for k <= n.

Examples

			a(4) = 23. The 23 prime decimal descendants of 4 are shown in the tree below.
       _____ 4__________________________
      /      |                          \
     41   ___43______________            47
    /    /   |               \             \
  419  431  433               439          479
            / \              /   \        /   \
        4337  4339         4391  4397   4793  4799
             /  |  \        |     |     /  \
        43391 43397 43399 43913 43973 47933 47939
                            |
                         439133
                            |
                        4391339
		

Crossrefs

Programs

  • Mathematica
    Table[Length@Rest@Flatten[FixedPointList[(b=#;Select[Flatten[(a=#;FromDigits/@(Join[IntegerDigits@a,{#}]&/@If[b=={0},Range@9,{1,3,7,9}]))&/@b],PrimeQ])&,{n}]],{n,0,76}] (* Giorgos Kalogeropoulos, Aug 16 2021 *)
  • Python
    from sympy import isprime
    def p_count(k):
        global ct; d = [2, 3, 5, 7] if k == 0 else [1, 3, 7, 9]
        for i in range(4):
            m = 10*k + d[i]
            if isprime(m): ct += 1; p_count(m)
        return ct
    for n in range(100):
        ct = 0; print(p_count(n))
Showing 1-2 of 2 results.