OFFSET
1,1
COMMENTS
From Richard R. Forberg, Mar 14 2016 : (Start)
Numbers m such that p^2 + q^2 + r^2 - m is a square, for distinct odd primes p, q, and r. This follows from the fact that the sum of the squares of three odd primes is 3 mod 8, and squares are {0,1,4} mod 8. Changing -m to +m leads to A047438.
The expression p^2 + q^2 + r^2 - m can equal the square of an odd number only when m == 2 mod 8 (because all odd squares are 1 mod 8).
This same expression only equals squares of primes for m in {2, 10, 26, 34} mod 48, because when m = {18, 42} mod 48, the expression is congruent to {9, 33} mod 48, which matches the values of (6*k-3)^2 mod 48.
(End)
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,0,1,-1).
FORMULA
From Chai Wah Wu, May 30 2016: (Start)
a(n) = a(n-1) + a(n-3) - a(n-4) for n > 4.
G.f.: x*(x^3 + 4*x^2 + x + 2)/(x^4 - x^3 - x + 1). (End)
a(n) = (24*n + 5*sqrt(3)*sin(2*Pi*n/3) + 3*cos(2*Pi*n/3) - 12)/9. - Ilya Gutkovskiy, May 30 2016
a(3k) = 8k-1, a(3k-1) = 8k-5, a(3k-2) = 8k-6. - Wesley Ivan Hurt, Jun 10 2016
MAPLE
A047531:=n->(24*n-12+3*cos(2*n*Pi/3)+5*sqrt(3)*sin(2*n*Pi/3))/9: seq(A047531(n), n=1..100); # Wesley Ivan Hurt, Jun 10 2016
MATHEMATICA
LinearRecurrence[{1, 0, 1, -1}, {2, 3, 7, 10}, 50] (* G. C. Greubel, May 30 2016 *)
Select[Range[200], MemberQ[{2, 3, 7}, Mod[#, 8]]&] (* Harvey P. Dale, Jan 18 2019 *)
PROG
(Magma) [n : n in [0..150] | n mod 8 in [2, 3, 7]]; // Wesley Ivan Hurt, Jun 10 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved