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.

Previous Showing 11-13 of 13 results.

A093502 a(1) = 2; for n > 0, a(n+1) is the a(n)-th prime after a(n).

Original entry on oeis.org

2, 5, 19, 103, 733, 6691, 76831, 1081429, 18242699, 361919671, 8309068723, 217809953467, 6445388418589, 213232943658197, 7821073506524401, 315743571062703689
Offset: 1

Views

Author

Amarnath Murthy, Apr 17 2004

Keywords

Comments

With prepended a(0) = 1 this is the lexicographically earliest infinite sequence such that A056239(a(n)) = a(n-1) + A056239(a(n-1)). - Antti Karttunen, Nov 02 2024

Examples

			19 follows 5 as there are 5 primes > 5 and up to 19 inclusive, (7,11,13,17,19).
		

Crossrefs

Programs

  • Mathematica
    a[1] := 2; a[n_] := Prime[PrimePi[a[n - 1]] + a[n - 1]]; Table[a[n], {n, 1, 10}] (* Stefan Steinerberger, Apr 10 2006 *)
    NestList[Prime[PrimePi[ # ] + # ] &, 2, 13] (* Zak Seidov, Mar 21 2009 *)
  • Python
    from sympy import prime
    p, q = 2, 1
    A093502_list = [p]
    for _ in range(15):
        r = p + q
        p, q = prime(r), r
        A093502_list.append(p) # Chai Wah Wu, Jun 17 2019

Formula

a(n) = prime(pi(a(n-1)) + a(n-1)). - Vladeta Jovovic, Jun 19 2004
a(1)=2, a(n) = next a(n-1)th prime after a(n-1). - Zak Seidov, Mar 21 2009
a(n+1) = A000040(a(n) + index of a(n) in A000040). - David James Sycamore, Aug 20 2017
a(n) = A000040(A074271(n)), A056239(a(n)) = A074271(n). - Antti Karttunen, Nov 02 2024

Extensions

a(10) from Vladeta Jovovic, Jun 19 2004
More terms from Stefan Steinerberger, Apr 10 2006
a(13) from Zak Seidov, Mar 21 2009
a(14)-a(15) from Donovan Johnson, Dec 08 2009
Better definition from Jon E. Schoenfield, Aug 22 2017
a(16) from Chai Wah Wu, Jun 17 2019

A181642 Minimal sequence whose forwards van Eck transform is the sequence of prime numbers.

Original entry on oeis.org

0, 1, 0, 2, 1, 3, 4, 0, 5, 6, 2, 7, 8, 9, 10, 1, 11, 12, 3, 13, 14, 15, 16, 4, 17, 18, 0, 19, 20, 21, 22, 5, 23, 24, 25, 26, 27, 28, 6, 29, 30, 2, 31, 32, 33, 34, 35, 36, 7, 37, 38, 39, 40, 8, 41, 42, 9, 43, 44, 45, 46, 10, 47, 48, 49, 50, 51, 52, 1, 53, 54
Offset: 1

Views

Author

Keywords

Comments

At each step, the minimum available integer is used.
From Rémy Sigrist, Aug 12 2017: (Start)
a(n)=0 iff n belongs to A074271.
a(n)=1 iff n > 1 and n belongs to A259408.
For any k > 0, A064427(k) = least n such that a(n) = k-1.
(End)

Examples

			a(1)=0. Next 0 is at distance 2 (1st prime): a(3)=0.
a(2)=1. Next 1 is at distance 3 (2nd prime): a(5)=1.
a(3)=0. Next 0 is at distance 5 (3rd prime): a(8)=0.
For a(4), we can use neither 0 (distance 1 from previous 0 would lead to an incongruence) nor 1 (distance 1 from subsequent 1 would lead to another incongruence). Therefore we must use 2.
Next 2 must be at distance 7 (4th prime): a(11)=2. And so on.
		

Crossrefs

Programs

  • Maple
    P:=proc(q,h) local i,k,n,t,x; x:=array(1..h); for k from 1 to h do x[k]:=-1; od; x[1]:=0; i:=0; t:=0;for n from 1 to q do if isprime(n) then  i:=i+1; if x[i]>-1 then x[i+n]:=x[i]; else t:=t+1; x[i]:=t; x[i+n]:=x[i]; fi; fi; od; seq(x[k],k=1..79); end: P(400,500);
  • PARI
    a = vector(71, i, -1); u = 0; for (n=1, #a, if (a[n]<0, o = n; while (o <= #a, a[o] = u; o += prime(o)); u++); print1 (a[n] ", ")) \\ Rémy Sigrist, Aug 12 2017

Extensions

More terms from Rémy Sigrist, Aug 12 2017

A259408 a(1) = 1 thereafter a(n) = Sum_{m=1..n-1} prime(a(m)).

Original entry on oeis.org

1, 2, 5, 16, 69, 416, 3277, 33590, 430131, 6700328, 124069971, 2680915918, 66579269891, 1876496610172, 59387269231505, 2091422223924852, 81321166136299741, 3467614972592015460
Offset: 1

Views

Author

Anders Hellström, Jun 26 2015

Keywords

Crossrefs

Cf. A074271.

Programs

  • Mathematica
    a = {1}; Do[AppendTo[a, Sum[Prime[a[[m]]], {m, n - 1}]], {n, 2, 15}];
    a (* Michael De Vlieger, Aug 06 2015 *)
  • PARI
    a(n) = if (n==1, 1, sum(k=1, n-1, prime(a(k)))); \\ Michel Marcus, Jun 26 2015
    
  • PARI
    first(m)=my(v=vector(m)); v[1]=1; print1(1); for(i=2, m, v[i]=sum(k=1, i-1, prime(v[k])); print1(", ", v[i])); v; \\ Anders Hellström, Aug 01 2015
    
  • PARI
    first(n)=my(v=vector(n,i,i)); for(i=3,n,v[i]=v[i-1]+prime(v[i-1])); v \\ Charles R Greathouse IV, Aug 06 2015
    
  • Perl
    use bignum;
    use Math::Prime::Util ':all';
    print "1\n2\n";
    my $a = 2;
    while(1){
      $a += nth_prime($a);
      print "$a\n";
    } # Charles R Greathouse IV, Aug 06 2015
    
  • Python
    from sympy import prime
    from functools import lru_cache
    @lru_cache()
    def a(n): return n if n < 3 else a(n-1) + prime(a(n-1))
    print([a(n) for n in range(1, 14)]) # Michael S. Branicky, Oct 07 2022

Formula

a(n) = A014688(a(n-1)) for n>2, a(1)=1, a(2)=2.

Extensions

a(15) from Michael De Vlieger, Jul 01 2015
a(16)-a(18) from Charles R Greathouse IV, Aug 06 2015
Previous Showing 11-13 of 13 results.