A280386 Number of ways to write n as the sum of two squares and a term of A000009.
1, 2, 3, 3, 4, 5, 4, 4, 4, 6, 5, 6, 5, 6, 5, 5, 5, 6, 7, 7, 6, 7, 7, 5, 4, 7, 7, 9, 5, 7, 8, 7, 6, 5, 9, 6, 8, 8, 6, 10, 6, 9, 7, 8, 5, 7, 10, 7, 5, 6, 9, 9, 7, 10, 11, 10, 6, 9, 8, 5, 5, 8, 10, 10, 6, 8, 10, 10, 7, 8, 9, 10, 8, 8, 8, 9, 10, 7, 8, 11
Offset: 1
Keywords
Examples
a(1) = 1 since 1 = 0^2 + 0^2 + 1 with 1 = A000009(1) = A000009(2). a(2) = 2 since 2 = 0^2 + 1^2 + 1 = 0^2 + 0^2 + 2 with 1 = A000009(1) = A000009(2) and 2 = A000009(3) = A000009(4).
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 1..10000
- Zhi-Wei Sun, Problems on combinatorial properties of primes, in: M. Kaneko, S. Kanemitsu and J. Liu (eds.), Number Theory: Plowing and Starring through High Wave Forms, Proc. 7th China-Japan Seminar (Fukuoka, Oct. 28--Nov. 1, 2013), Ser. Number Theory Appl., Vol. 11, World Sci., Singapore, 2015, pp. 169-187.
Programs
-
Mathematica
SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]]; q[n_]:=q[n]=PartitionsQ[n]; ex={};Do[r=0;m=2;Label[bb];If[q[m]>n,Goto[cc]];Do[If[SQ[n-q[m]-x^2],r=r+1],{x,0,Sqrt[(n-q[m])/2]}];m=m+If[m<3,2,1];Goto[bb];Label[cc];ex=Append[ex,r];Continue,{n,1,80}]
Comments