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.

A134397 A077018 * A007318.

Original entry on oeis.org

1, 2, 1, 4, 4, 1, 8, 12, 6, 1, 15, 30, 23, 8, 1, 26, 65, 68, 37, 10, 1, 42, 126, 168, 126, 54, 12, 1, 64, 224, 364, 350, 208, 74, 14, 1, 93, 372, 714, 840, 642, 318, 97, 16, 1, 130, 585, 1296, 1806, 1692, 1080, 460, 123, 18, 1
Offset: 0

Views

Author

Gary W. Adamson, Oct 23 2007

Keywords

Comments

Row sums = A048481: (1, 3, 9, 27, 77, 207, 529, ...).

Examples

			First few rows of the triangle:
   1;
   2,   1;
   4,   4,   1;
   8,  12,   6,   1;
  15,  30,  23,   8,  1;
  26,  65,  68,  37, 10,  1;
  42, 126, 168, 126, 54, 12, 1;
  ...
		

Crossrefs

Formula

A077018 * A007318 as infinite lower triangular matrices.

A115061 a(n) is the number of occurrences of the n-th prime number in A051697.

Original entry on oeis.org

3, 2, 2, 3, 3, 3, 3, 3, 5, 4, 4, 5, 3, 3, 5, 6, 4, 4, 5, 3, 4, 5, 5, 7, 6, 3, 3, 3, 3, 9, 9, 5, 4, 6, 6, 4, 6, 5, 5, 6, 4, 6, 6, 3, 3, 7, 12, 8, 3, 3, 5, 4, 6, 8, 6, 6, 4, 4, 5, 3, 6, 12, 9, 3, 3, 9, 10, 8, 6, 3, 5, 7, 7, 6, 5, 5, 7, 6, 6
Offset: 1

Views

Author

Lekraj Beedassy, Mar 01 2006

Keywords

Comments

Except for the second entry, the sequence also holds with respect to A077018.
a(n) equals A162345(n) for n>1 and equals A052288(n-2) for n>2. - Nathaniel Johnston, Jun 25 2011

Examples

			The 5th prime number, 11, appears three times in A051697. Therefore a(5) = 3.
		

Programs

  • Mathematica
    a = {3}; For[n = 2, n < 100, n++, c = 0; For[j = Prime[n - 1], j < Prime[n + 1], j++, If[j < Prime[n], If[Prime[n] - j < j - Prime[n - 1], c++ ], If[Not[Prime[n + 1] - j < j - Prime[n]], c++ ]]]; AppendTo[a, c]]; a

Formula

a(n) = (prime(n+1) - prime(n-1))/2 for n>=3. - Nathaniel Johnston, Jun 25 2011

Extensions

Edited and extended by Stefan Steinerberger, Oct 27 2007

A262463 If n is prime a(n) = n else a(n) = nextprime(reverse(n)), where "next prime" is the smallest prime >= n, see A007918.

Original entry on oeis.org

2, 2, 3, 5, 5, 7, 7, 11, 11, 2, 11, 23, 13, 41, 53, 61, 17, 83, 19, 2, 13, 23, 23, 43, 53, 67, 73, 83, 29, 3, 31, 23, 37, 43, 53, 67, 37, 83, 97, 5, 41, 29, 43, 47, 59, 67, 47, 89, 97, 5, 17, 29, 53, 47, 59, 67, 79, 89, 59, 7, 61, 29, 37, 47, 59, 67, 67, 89, 97, 7, 71, 29, 73, 47, 59, 67, 79, 89, 79, 11, 19, 29
Offset: 1

Views

Author

Maghraoui Abdelkader, Sep 23 2015

Keywords

Examples

			For n=7 a(7)=7.
For n=12, reverse(12)=21; a(12)=nextprime(21)=23.
		

Crossrefs

Programs

  • Mathematica
    Table[Which[PrimeQ[n],n,PrimeQ[IntegerReverse[n]],IntegerReverse[n], True, NextPrime[ IntegerReverse[ n]]],{n,100}] (* Harvey P. Dale, May 12 2018 *)
  • PARI
    rev(n)={d=digits(n); p=""; for(i=1, #d, p=concat(Str(d[i]), p)); return(eval(p))}
    i=0; t=vector(200);
    findn(n)={if(isprime(n),t[i++]=n, a=rev(n); b=nextprime(a); t[i++]=b); }
    for(n=1,200,findn(n)); t

Formula

a(n)=n if n is prime;
else b=reverse(n);
if b is prime a(n)=b else a(n)=nextprime(b);
(using "next prime" function as "smallest prime >= n"; see A007918. )
Showing 1-3 of 3 results.