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.

A005041 A self-generating sequence.

Original entry on oeis.org

1, 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18
Offset: 0

Views

Author

Keywords

Comments

See A008620 for run lengths: each k occurs A008620(k+2) times. - Reinhard Zumkeller, Mar 16 2012

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a005041 n = a005041_list !! n
    a005041_list = 1 : f 1 1 (tail ts) where
       f y i gs'@((j,a):gs) | i < j  = y : f y (i+1) gs'
                            | i == j = a : f a (i+1) gs
       ts = [(6*k + 3*k*(k-1) `div` 2 + r*(k+2), 3*k+r+1) |
             k <- [0..], r <- [0,1,2]]
    -- Reinhard Zumkeller, Mar 16 2012
  • Mathematica
    Table[n+1, {n, 0, 20}, {Ceiling[(n+1)/3]+1}] // Flatten (* Jean-François Alcover, Dec 10 2014 *)

Formula

For any k in {0, 1, 2, ...} and r in {0, 1, 2}, we have: if n = 6*k + (3/2)*k*(k-1) + r*(k+2), then a(n) = 3*k + r + 1. E.g., for k=3 and r=1, we have n = 6*3 + (3/2)*3*(3-1) + 1*(3+2) = 32 and so a(32) = 3*3 + 1 + 1 = 11. - Francois Jooste (phukraut(AT)hotmail.com), Mar 12 2002

Extensions

More terms from Samuel Hilliard (sam_spade1977(AT)hotmail.com), Apr 11 2004

A139789 Numbers of primes < n-th-prime such that prime(n) + 4 is prime.

Original entry on oeis.org

0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 4, 4, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 21, 21, 21
Offset: 1

Views

Author

Giovanni Teofilatto, May 21 2008

Keywords

Crossrefs

Cf. A082462.

Programs

  • Maple
    A139789 := proc(n) local a,i; a := 0 ; for i from 1 to n-1 do if isprime(ithprime(i)+4) then a :=a +1 ; fi; od: a ; end: for n from 1 to 100 do printf("%d,",A139789(n)) ; od: # R. J. Mathar, Oct 05 2008
  • Mathematica
    Join[{0},Accumulate[Table[If[PrimeQ[n+4],1,0],{n,Prime[Range[80]]}]]] (* Harvey P. Dale, Jan 25 2019 *)

Extensions

0 added in front, some 6's added and extended by R. J. Mathar, Oct 05 2008

A145197 Partial sums of number of primes < n-th prime p such that p+2 is prime.

Original entry on oeis.org

0, 1, 3, 5, 8, 11, 15, 19, 23, 28, 33, 38, 44, 50, 56, 62, 69, 76, 83, 91, 99, 107, 115, 123, 131, 140, 149, 159, 169, 179, 189, 199, 210, 221, 233, 245, 257, 269, 281, 293, 306, 319, 333, 347, 362, 377, 392, 407, 423, 439, 455, 472, 489, 506, 523, 540, 558, 576
Offset: 1

Views

Author

Giovanni Teofilatto, Oct 04 2008

Keywords

Comments

Partial sums of A082462. [R. J. Mathar, Oct 06 2008]

Programs

  • Maple
    isA001359 := proc(p) if isprime(p) and isprime(p+2) then 1; else 0; fi; end: A082462 := proc(n) add( isA001359(ithprime(i)),i=1..n) ; end: A145197 := proc(n) add( A082462(i),i=1..n) ; end: for n from 1 to 200 do printf("%d,",A145197(n)) ; od: # R. J. Mathar, Oct 06 2008

Extensions

Corrected and extended by R. J. Mathar, Oct 06 2008
Showing 1-3 of 3 results.