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-3 of 3 results.

A035346 Let F(n) = Q(n) - P(n) be the Fortunate numbers (A005235); sequence gives n such that F(n) = prime(n+1).

Original entry on oeis.org

1, 2, 3, 6, 7, 8, 14, 16, 17, 21, 73, 801, 1971, 3332, 3469, 3509, 4318, 7986, 41292
Offset: 1

Views

Author

Keywords

Comments

Positive n such that A002110(n) + A000040(n+1) is prime. - Robert Israel, Dec 02 2015
Subsequence of A265109. - Altug Alkan, Dec 02 2015

Examples

			a(10) = 21 because A002110(21) + prime(22) = 40729680599249024150621323549 = 2*3*5*...*67*71*73 + 79 is prime.
		

Crossrefs

Programs

  • Maple
    p:= 3:
    A[1]:= 1:
    count:= 1:
    Primorial:= 2:
    for n from 2 to 1000 do
      Primorial:= Primorial*p;
      p:= nextprime(p);
      if isprime(Primorial + p) then
        count:= count+1;
        A[count]:= n;
      fi
    od:
    seq(A[i],i=1..count); # Robert Israel, Dec 02 2015
  • Mathematica
    Select[Range@ 801, PrimeQ[Product[Prime@ k, {k, #}] + Prime[# + 1]] &] (* Michael De Vlieger, Dec 02 2015 *)
  • PARI
    lista(nn) = {s = 1; for(k=1, nn, s *= prime(k); if(ispseudoprime(s + prime(k+1)), print1(k, ", ")); ); } \\ Altug Alkan, Dec 02 2015

Extensions

a(10)-a(11) were found by Labos Elemer, May 02 2000
a(12) from Ralf Stephan, Oct 20 2002
Offset changed by Altug Alkan, Dec 02 2015
a(13) from Michael De Vlieger, Dec 02 2015
a(14)-a(18) from Altug Alkan, Dec 02 2015
a(19) from Henri Lifchitz, Nov 08 2024

A100380 a(n) = least k such that prime(n) + A002110(k) is prime.

Original entry on oeis.org

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

Views

Author

Pierre CAMI, Dec 30 2004

Keywords

Comments

Conjecture: every prime number can be written as +- p(n) -+ p(k)# where p(i)=i-th prime, p(i)#=i-th primorial.
The sequence grows remarkably slowly. The largest number occurring within the first 50000 elements is 90. - Stefan Steinerberger, Apr 10 2006
a(1) = 0 is the minimum value of a(n). It is also unrepeated in this sequence. - Altug Alkan, Dec 02 2015

Examples

			prime(8)=19;
19 + 2 = 21 = 3*7,
19 + 6 = 25 = 5*5, and
19 + 30 = 49 = 7*7, but
19 + 210 = 229, which is prime; 210=prime(4)#, so a(8)=4.
		

Crossrefs

Programs

  • Maple
    primorial:= proc(n) option remember: ithprime(n)*procname(n-1) end proc:
    primorial(0):= 1:
    f:= proc(n) local k, p;
      p:= ithprime(n);
      for k from 0 do if isprime(p+primorial(k)) then return k fi od:
    end proc:
    map(f, [$1..100]);# Robert Israel, Aug 27 2015
  • Mathematica
    Table[k := 0;While[Not[PrimeQ[Prime[n]+Product[Prime[i],{i,1,k}]]],k++ ];k,{n,1, 100}] (* Stefan Steinerberger, Apr 10 2006 *)
  • PARI
    primo(n) = prod(i=1, n, prime(i));
    a(n) = {k=0; while(!isprime(prime(n)+primo(k)), k++); k;} \\ Michel Marcus, Aug 27 2015
    
  • Python
    from itertools import count, islice
    from sympy import isprime, prime, primorial
    def A002110(n): return primorial(n) if n > 0 else 1
    def A100380(n):
        pn = prime(n)
        return next(k for k in count(0) if isprime(pn+A002110(k)))
    print([a(n) for n in range(1, 101)]) # Michael S. Branicky, Jan 10 2025

Extensions

More terms from Stefan Steinerberger, Apr 10 2006
a(1) = 0 added and name edited by Altug Alkan, Dec 02 2015

A380027 a(n) is the largest prime p such that p - a(n-1) is a primorial, starting with a(1) = 2.

Original entry on oeis.org

2, 3, 5, 11, 41, 9699731
Offset: 1

Views

Author

Hayden Chesnut, Jan 09 2025

Keywords

Comments

From Michael S. Branicky, Jan 11 2025: (Start)
The corresponding k are such that 0 <= k < PrimePi(P), so a(n-1)+1 <= a(n) <= a(n-1)+primorial(PrimePi(a(n-1))-1).
a(7) >= 9699731 + primorial(452), which is prime and has 1351 digits, so it is too large to include, even in a b-file. (End)

Examples

			a(3) = 5
For primes less than 5+5#:
31 - 5 = 26 is not in A002110
...
13 - 5 = 8 is not in A002110
11 - 5 = 6 is in A002110 so a(4) = 11
		

Crossrefs

Programs

  • Python
    from itertools import count, islice
    from sympy import isprime, primepi, primorial
    def A002110(n): return primorial(n) if n > 0 else 1
    def agen(an=2): # generator of terms
        while True:
            yield an
            an = next(s for k in range(primepi(an)-1, -1, -1) if isprime(s:=an+A002110(k)))
    print(list(islice(agen(), 6))) # Michael S. Branicky, Jan 11 2025

Formula

a(n) = a(n-1) + A002110(A265109(A000720(a(n-1)))), for n > 1. - Michael S. Branicky, Jan 10 2025
Showing 1-3 of 3 results.