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

A306362 Prime numbers in A317298.

Original entry on oeis.org

3, 11, 37, 79, 137, 211, 821, 991, 1597, 1831, 2081, 2347, 2927, 3571, 3917, 4657, 5051, 6329, 8779, 9871, 11027, 14197, 14879, 17021, 20101, 21737, 26107, 27967, 28921, 33931, 34981, 39341, 40471, 41617, 50087, 51361, 59341, 60727, 62129, 66431, 69379, 70877
Offset: 1

Views

Author

Stefano Spezia, Feb 10 2019

Keywords

Comments

Conjecture: Except the first term a(1) = 3, all the other terms do not end with 3.
It is easy to prove that the numbers A317298(n) end with 3 only when n ends with 1. In this case A317298(10*n+1) = (10*n + 1)*(20*n + 3), which is composite for n > 0. Therefore the conjecture is true. - Bruno Berselli, Feb 11 2019
Essentially (apart from the 3) the same as A188382, because for even n, A317298(n=2k) has the form 1+2*k+8*k^2 and for odd n A317298(n) is a multiple of n and not prime. - R. J. Mathar, Feb 14 2019

Crossrefs

Programs

  • Mathematica
    Select[Table[(1/2)*(1 + (-1)^n + 2*n + 4*n^2),{n,1,300}], PrimeQ]
  • PARI
    for(n=0, 300, if(ispseudoprime(t=(1/2)*(1 + (-1)^n + 2*n + 4*n^2)), print1(t", ")));

A304487 a(n) = (3 + 2*n - 3*n^2 + 4*n^3 - 3*((-1 + n) mod 2))/6.

Original entry on oeis.org

1, 4, 15, 36, 73, 128, 207, 312, 449, 620, 831, 1084, 1385, 1736, 2143, 2608, 3137, 3732, 4399, 5140, 5961, 6864, 7855, 8936, 10113, 11388, 12767, 14252, 15849, 17560, 19391, 21344, 23425, 25636, 27983, 30468, 33097, 35872, 38799, 41880, 45121, 48524, 52095
Offset: 1

Views

Author

Stefano Spezia, Aug 17 2018

Keywords

Comments

a(n) is the trace of an n X n matrix A in which the entries are 1 through n^2, spiraling inward starting with 1 in the (1,1)-entry (proved).
The first three terms of a(n) coincide with those of A317614.

Examples

			For n = 1 the matrix A is
   1
with trace Tr(A) = a(1) = 1.
For n = 2 the matrix A is
   1, 2
   4, 3
with Tr(A) = a(2) = 4.
For n = 3 the matrix A is
   1, 2, 3
   8, 9, 4
   7, 6, 5
with Tr(A) = a(3) = 15.
For n = 4 the matrix A is
   1,  2,  3, 4
  12, 13, 14, 5
  11, 16, 15, 6
  10,  9,  8, 7
with Tr(A) = a(4) = 36.
		

Crossrefs

Cf. A126224 (determinant of the matrix A), A317298 (first differences).

Programs

  • GAP
    a_n:=List([1..43], n->(3 + 2*n - 3*n^2 + 4*n^3 - 3*RemInt(-1 + n, 2))/6);
    
  • GAP
    List([1..43],n->(3+2*n-3*n^2+4*n^3-3*((-1+n) mod 2))/6); # Muniru A Asiru, Sep 17 2018
  • Magma
    I:=[1,4,15,36,73]; [n le 5 select I[n] else 3*Self(n-1)-2*Self(n-2)-2*Self(n-3)+3*Self(n-4)-Self(n-5): n in [1..43]]; // Vincenzo Librandi, Aug 26 2018
    
  • Maple
    seq((3+2*n-3*n^2+4*n^3-3*modp((-1+n),2))/6,n=1..43); # Muniru A Asiru, Sep 17 2018
  • Mathematica
    Table[1/6 (3 + 2 n - 3 n^2 + 4 n^3 - 3 Mod[-1 + n, 2]), {n, 1, 43}] (* or *)
    CoefficientList[ Series[x*(1 + x + 5 x^2 + x^3)/((-1 + x)^4 (1 + x)), {x, 0, 43}], x] (* or *)
    LinearRecurrence[{3, -2, -2, 3, -1}, {1, 4, 15, 36, 73}, 43]
  • Maxima
    a(n):=(3 + 2*n - 3*n^2 + 4*n^3 - 3*mod(-1 + n, 2))/6$ makelist(a(n), n, 1, 43);
    
  • PARI
    Vec(x*(1 + x + 5*x^2 + x^3)/((-1 + x)^4*(1 + x)) + O(x^44))
    
  • PARI
    a(n) = (3 + 2*n - 3*n^2 + 4*n^3 - 3*((-1 + n)%2))/6
    

Formula

a(n) = A045991(n) - Sum_{k=2..n-1} A085046(k) for n > 2 (proved).
G.f.: x*(1 + x + 5 x^2 + x^3)/((-1 + x)^4 (1 + x)).
a(n) + a(n + 1) = A228958(2*n + 1).
From Colin Barker, Aug 17 2018: (Start)
a(n) = (2*n - 3*n^2 + 4*n^3) / 6 for n even.
a(n) = (3 + 2*n - 3*n^2 + 4*n^3) / 6 for n odd.
a(n) = 3*a(n - 1) - 2*a(n - 2) - 2*a(n - 3) + 3*a(n - 4) - a(n - 5) for n > 5.
(End)
E.g.f.: (1/12)*exp(-x)*(-3 + exp(2*x)*(3 + 6*x + 18*x^2 + 8*x^3)). - Stefano Spezia, Feb 10 2019
Showing 1-2 of 2 results.