OFFSET
1,2
COMMENTS
This period 24 repeating sequence is palindromic.
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (2,-1,-1,2,-1,-1,2,-2,1,1,-2,1,1,-2,1).
FORMULA
From Colin Barker, Sep 21 2019: (Start)
G.f.: x*(1 + x)^2*(1 - 4*x^2 + 12*x^3 - 27*x^4 + 45*x^5 - 53*x^6 + 45*x^7 - 27*x^8 + 12*x^9 - 4*x^10 + x^12) / ((1 - x)*(1 - x + x^2)*(1 - x^2 + x^4)*(1 - x^4 + x^8)).
a(n) = 2*a(n-1) - a(n-2) - a(n-3) + 2*a(n-4) - a(n-5) - a(n-6) + 2*a(n-7) - 2*a(n-8) + a(n-9) + a(n-10) - 2*a(n-11) + a(n-12) + a(n-13) - 2*a(n-14) + a(n-15) for n>15.
(End)
EXAMPLE
The first 8 numbers not divisible by 2, 3 or 5 are 1,7,11,13,17,19,23,29; with squares 1,49,121,169,289,361,529,841 and digital root sequence of 1,4,4,7,1,1,7,4.
PROG
(Python)
A240924 = [1 + (n*n-1) % 9 for n in range(1, 10**3, 2) if n % 3 and n % 5 ]
# Chai Wah Wu, Sep 03 2014
(PARI) Vec(x*(1 + x)^2*(1 - 4*x^2 + 12*x^3 - 27*x^4 + 45*x^5 - 53*x^6 + 45*x^7 - 27*x^8 + 12*x^9 - 4*x^10 + x^12) / ((1 - x)*(1 - x + x^2)*(1 - x^2 + x^4)*(1 - x^4 + x^8)) + O(x^100)) \\ Colin Barker, Sep 21 2019
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Gary Croft, Aug 15 2014
STATUS
approved