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.

A346494 Heptagonal numbers (A000566) with prime indices (A000040).

Original entry on oeis.org

7, 18, 55, 112, 286, 403, 697, 874, 1288, 2059, 2356, 3367, 4141, 4558, 5452, 6943, 8614, 9211, 11122, 12496, 13213, 15484, 17098, 19669, 23377, 25351, 26368, 28462, 29539, 31753, 40132, 42706, 46717, 48094, 55279, 56776, 61387, 66178, 69472, 74563, 79834
Offset: 1

Views

Author

Dumitru Damian, Aug 22 2021

Keywords

Examples

			a(1) = Heptagonal(prime(1)) = A000566(2) = 2*(5*2-3)/2 = 7;
a(2) = Heptagonal(prime(2)) = A000566(3) = 3*(5*3-3)/2 = 18;
a(3) = Heptagonal(prime(3)) = A000566(5) = 5*(5*5-3)/2 = 55.
		

Crossrefs

Programs

  • Mathematica
    A346494[n_] := PolygonalNumber[7, Prime[n]]; Table[A346494[n], {n, 1, 41}] (* Robert P. P. McKone, Aug 22 2021 *)
  • PARI
    a(n) = my(p=prime(n)); p*(5*p-3)/2; \\ Michel Marcus, Sep 16 2021
  • Python
    from sympy import primerange
    print([p*(5*p-3)//2 for p in primerange(1, 180)]) # Michael S. Branicky, Aug 22 2021
    
  • Sage
    A = [int(p*(5*p-3)/2) for p in range(0,10^3) if p in Primes()]
    

Formula

a(n) = A000566(A000040(n)) = prime(n)*(5*prime(n)-3)/2.