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-10 of 18 results. Next

A000161 Number of partitions of n into 2 squares.

Original entry on oeis.org

1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 2, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 2, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 2, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 2, 1, 0, 0, 1, 0, 1, 0
Offset: 0

Views

Author

Keywords

Comments

Number of ways of writing n as a sum of 2 (possibly zero) squares when order does not matter.
Number of similar sublattices of square lattice with index n.
Let Pk = the number of partitions of n into k nonzero squares. Then we have A000161 = P0 + P1 + P2, A002635 = P0 + P1 + P2 + P3 + P4, A010052 = P1, A025426 = P2, A025427 = P3, A025428 = P4. - Charles R Greathouse IV, Mar 08 2010, amended by M. F. Hasler, Jan 25 2013
a(A022544(n))=0; a(A001481(n))>0; a(A125022(n))=1; a(A118882(n))>1. - Reinhard Zumkeller, Aug 16 2011

Examples

			25 = 3^2+4^2 = 5^2, so a(25) = 2.
		

References

  • J. V. Uspensky and M. A. Heaslet, Elementary Number Theory, McGraw-Hill, NY, 1939, p. 339

Crossrefs

Equivalent sequences for other numbers of squares: A010052 (1), A000164 (3), A002635 (4), A000174 (5).

Programs

  • Haskell
    a000161 n =
       sum $ map (a010052 . (n -)) $ takeWhile (<= n `div` 2) a000290_list
    a000161_list = map a000161 [0..]
    -- Reinhard Zumkeller, Aug 16 2011
    
  • Maple
    A000161 := proc(n) local i,j,ans; ans := 0; for i from 0 to n do for j from i to n do if i^2+j^2=n then ans := ans+1 fi od od; RETURN(ans); end; [ seq(A000161(i), i=0..50) ];
    A000161 := n -> nops( numtheory[sum2sqr](n) ); # M. F. Hasler, Nov 23 2007
  • Mathematica
    Length[PowersRepresentations[ #,2,2]] &/@Range[0,150] (* Ant King, Oct 05 2010 *)
  • PARI
    a(n)=sum(i=0,n,sum(j=0,i,if(i^2+j^2-n,0,1))) \\ for illustrative purpose
    
  • PARI
    A000161(n)=sum(k=sqrtint((n-1)\2)+1,sqrtint(n),issquare(n-k^2)) \\ Charles R Greathouse IV, Mar 21 2014, improves earlier code by M. F. Hasler, Nov 23 2007
    
  • PARI
    A000161(n)=#sum2sqr(n) \\ See A133388 for sum2sqr(). - M. F. Hasler, May 13 2018
    
  • Python
    from math import prod
    from sympy import factorint
    def A000161(n):
        f = factorint(n)
        return int(not any(e&1 for e in f.values())) + (((m:=prod(1 if p==2 else (e+1 if p&3==1 else (e+1)&1) for p, e in f.items()))+((((~n & n-1).bit_length()&1)<<1)-1 if m&1 else 0))>>1) if n else 1 # Chai Wah Wu, Sep 08 2022

Formula

a(n) = card { { a,b } c N | a^2+b^2 = n }. - M. F. Hasler, Nov 23 2007
Let f(n)= the number of divisors of n that are congruent to 1 modulo 4 minus the number of its divisors that are congruent to 3 modulo 4, and define delta(n) to be 1 if n is a perfect square and 0 otherwise. Then a(n)=1/2 (f(n)+delta(n)+delta(1/2 n)). - Ant King, Oct 05 2010

A045847 Matrix whose (i,j)-th entry is number of representations of j as a sum of i squares of nonnegative integers; read by diagonals.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 2, 0, 0, 1, 3, 1, 0, 0, 1, 4, 3, 0, 1, 0, 1, 5, 6, 1, 2, 0, 0, 1, 6, 10, 4, 3, 2, 0, 0, 1, 7, 15, 10, 5, 6, 0, 0, 0, 1, 8, 21, 20, 10, 12, 3, 0, 0, 0, 1, 9, 28, 35, 21, 21, 12, 0, 1, 1, 0, 1, 10, 36, 56, 42, 36, 30, 4, 3, 2, 0, 0, 1, 11, 45, 84, 78, 63, 61, 20, 6, 6, 2, 0, 0
Offset: 0

Views

Author

Keywords

Examples

			Rows are
1,0,0,..;
1,1,0,0,1,0..;
1,2,1,0,2,2,..;
1,3,3,1,...
		

Crossrefs

Diagonal gives A287617.
Antidiagonal sums give A302018.

Formula

i-th row is expansion of (1+x+x^4+x^9+...)^i.

Extensions

More terms from Erich Friedman

A014110 Number of ordered ways of writing n as a sum of 4 squares of nonnegative integers.

Original entry on oeis.org

1, 4, 6, 4, 5, 12, 12, 4, 6, 16, 18, 12, 8, 16, 24, 12, 5, 24, 30, 16, 18, 28, 24, 12, 12, 28, 42, 28, 12, 36, 48, 16, 6, 36, 42, 36, 29, 28, 48, 28, 18, 48, 60, 28, 24, 60, 48, 24, 8, 44, 72, 48, 30, 48, 84, 36, 24, 52, 54, 48, 36, 52, 72, 52, 5, 72, 96, 40, 42, 72
Offset: 0

Views

Author

Joe Keane (jgk(AT)jgk.org)

Keywords

Comments

This counts ordered sums of squares of nonnegative integers, whereas A000118 counts ordered sums of squares of integers of any sign. - R. J. Mathar, May 16 2023

Examples

			From  _R. J. Mathar_, May 16 2023: (Start)
a(1)=4 counts 0^2+0^2+0^2+1^2 = 0^2+0^2+1^2+0^2 = 0^2+1^2+0^2+0^2 = 1^2+0^2+0^2+0^2.
a(2)=6 counts 0^2+0^2+1^2+1^2 = 0^2+1^2+0^2+1^2 = 0^2+1^2+1^2+0^2 = 1^2+0^2+0^2+1^2 = 1^2+0^2+1^2+0^2 = 1^2+1^2+0^2+0^2. (End)
		

Crossrefs

Convolution square of A000925.

Programs

Formula

Coefficient of q^n in (1/16)*(1 + theta_3(0, q))^4; or coeff. of q^n in (Sum q^(i^2), i=0..inf)^4.

A224212 Number of nonnegative solutions to x^2 + y^2 <= n.

Original entry on oeis.org

1, 3, 4, 4, 6, 8, 8, 8, 9, 11, 13, 13, 13, 15, 15, 15, 17, 19, 20, 20, 22, 22, 22, 22, 22, 26, 28, 28, 28, 30, 30, 30, 31, 31, 33, 33, 35, 37, 37, 37, 39, 41, 41, 41, 41, 43, 43, 43, 43, 45, 48, 48, 50, 52, 52, 52, 52, 52, 54, 54, 54, 56, 56, 56, 58, 62, 62, 62, 64
Offset: 0

Views

Author

Alex Ratushnyak, Apr 01 2013

Keywords

Crossrefs

Cf. A000925 (first differences).
Cf. A000606 (number of nonnegative solutions to x^2 + y^2 + z^2 <= n).
Cf. A057655 (number of integer solutions to x^2 + y^2 <= n).

Programs

  • Mathematica
    nn = 68; t = Table[0, {nn}]; Do[d = x^2 + y^2; If[0 < d <= nn, t[[d]]++], {x, 0, nn}, {y, 0, nn}]; Accumulate[Join[{1}, t]] (* T. D. Noe, Apr 01 2013 *)
  • Python
    for n in range(99):
      k = 0
      for x in range(99):
        s = x*x
        if s>n: break
        for y in range(99):
            sy = s + y*y
            if sy>n: break
            k+=1
      print(str(k), end=', ')

Formula

G.f.: (1/(1 - x))*(Sum_{k>=0} x^(k^2))^2. - Ilya Gutkovskiy, Mar 14 2017

A240088 The number of ways of writing n as an ordered sum of a triangular number (A000217), a square (A000290) and a pentagonal number (A000326).

Original entry on oeis.org

1, 3, 3, 2, 3, 4, 4, 4, 3, 3, 5, 5, 5, 3, 3, 7, 7, 5, 2, 6, 5, 4, 8, 5, 6, 4, 8, 7, 5, 7, 4, 9, 6, 5, 4, 3, 9, 12, 9, 4, 7, 9, 8, 4, 6, 8, 7, 8, 4, 8, 9, 10, 9, 6, 10, 6, 7, 10, 9, 8, 7, 11, 7, 4, 10, 8, 10, 10, 7, 5, 10, 14, 11, 7, 6, 11, 10, 10, 4, 11, 10, 10, 13, 8, 7, 7, 13, 12, 8, 8, 6, 10, 17, 8, 10, 7, 16, 10, 3, 12, 9
Offset: 0

Views

Author

Robert G. Wilson v, Mar 31 2014

Keywords

Comments

0 and 1 are triangular numbers, square numbers and pentagonal numbers.
It is conjectured that a(n) is always positive - this is one of the conjectures in Conjecture 1.1 of Sun (2009). - N. J. A. Sloane, Apr 01 2014
Note that both the conjecture in A160325 and the conjecture in A160324 imply that a(n) is always positive. - Zhi-Wei Sun, Apr 01 2014
a(n) > 0 for all n < 10^10. - Robert G. Wilson v, Aug 20 2016
Least number to be represented k ways, k >= 1: 0, 3, 1, 5, 10, 19, 15, 22, 31, 51, 61, 37, 82, 71, 126, 96, 92, 136, 162, 187, 206, 276, 191, 261, 236, 247, 317, 302, 401, 292, 422, 547, 456, 544, 551, 612, 591, 577, 521, 666, 742, 726, 682, 877, 796, 1052, 961, 1046, 1171, 1027, ..., . A275999.
Greatest number (conjectured) to be represented k ways, k >= 1: 0, 18, 168, 78, 243, 130, 553, 455, 515, 658, 865, 945, 633, 1918, 2258, 1385, 1583, 2828, 2135, 2335, 2785, 4533, 3168, 3478, 2790, 3868, 4193, 7328, 4953, 5278, 6390, 8148, 8015, 4585, 9160, 10485, 7613, 12333, 12025, 10178, 9923, 9720, 12558, 11340, 17420, 11753, 14893, 16155, 16415, 14343, ..., .
Conjectured lists of numbers that are represented in k >= 1 ways:
1: 0;
2: 3, 18;
3: 1, 2, 4, 8, 9, 13, 14, 35, 98, 168;
4: 5, 6, 7, 21, 25, 30, 34, 39, 43, 48, 63, 78;
5: 10, 11, 12, 17, 20, 23, 28, 33, 69, 193, 203, 230, 243;
6: 19, 24, 32, 44, 53, 55, 74, 90, 111, 130;
7: 15, 16, 27, 29, 40, 46, 56, 60, 62, 68, 73, 84, 85, 95, 108, 113, 123, 135, 139, 163, 165, 273, 553;
8: 22, 26, 42, 45, 47, 49, 59, 65, 83, 88, 89, 93, 112, 119, 125, 134, 140, 144, 186, 205, 233, 244, 320, 405, 455;
9: 31, 36, 38, 41, 50, 52, 58, 100, 109, 124, 160, 214, 249, 308, 358, 515; ..., .

Crossrefs

Programs

  • Maple
    # requires Maple 17 and up
    with(SignalProcessing):
    N:= 10000;  # to get terms up to a(N)
    A:= Array(0..N,datatype=float);
    B:= Array(0..N,datatype=float);
    C:= Array(0..N,datatype=float);
    for i from 0 to floor(sqrt(N)) do A[i^2]:= 1 od:
    for i from 0 to floor((1+sqrt(1+8*N))/2) do B[i*(i-1)/2]:= 1 od:
    for i from 0 to floor((1+sqrt(1+24*N))/6) do C[i*(3*i-1)/2]:= 1 od:
    R:= Convolution(Convolution(A,B),C);
    R:= evalhf(map(round,R));
    # Note that a(i) = R[i+1] for i from 0 to N
    # Robert Israel, Apr 01 2014
  • Mathematica
    p = Table[n (3n - 1)/2, {n, 0, 26}]; s = Table[n^2, {n, 0, 32}]; t = Table[n (n + 1)/2, {n, 0, 45}]; a = Sort@ Flatten@ Table[ p[[i]] + s[[j]] + t[[k]], {i, 26}, {j, 32}, {k, 45}]; Table[ Count[a, n], {n, 0, 105}]

A283305 List points (x,y) having integer coordinates with x >= 0, y >= 0, sorted first by x^2+y^2 and in case of a tie, by x-coordinate. Sequence gives x-coordinates.

Original entry on oeis.org

0, 0, 1, 1, 0, 2, 1, 2, 2, 0, 3, 1, 3, 2, 3, 0, 4, 1, 4, 3, 2, 4, 0, 3, 4, 5, 1, 5, 2, 5, 4, 3, 5, 0, 6, 1, 6, 2, 6, 4, 5, 3, 6, 0, 7, 1, 5, 7, 4, 6, 2, 7, 3, 7, 5, 6, 0, 8, 1, 4, 7, 8, 2, 8, 6, 3, 8, 5, 7, 4, 8, 0, 9, 1, 9, 2, 6, 7, 9, 5, 8, 3, 9, 4, 9, 7, 0, 6, 8, 10, 1, 10, 2, 10, 5, 9, 3, 10, 7, 8
Offset: 1

Views

Author

N. J. A. Sloane, Mar 04 2017, following a suggestion from Ahmet Arduç

Keywords

Examples

			The first few points (listing [x^2+y^2,x,y]) are: [0, 0, 0], [1, 0, 1], [1, 1, 0], [2, 1, 1], [4, 0, 2], [4, 2, 0], [5, 1, 2], [5, 2, 1], [8, 2, 2], [9, 0, 3], [9, 3, 0], [10, 1, 3], [10, 3, 1], [13, 2, 3], [13, 3, 2], [16, 0, 4], [16, 4, 0], [17, 1, 4], [17, 4, 1], [18, 3, 3], [20, 2, 4], [20, 4, 2], [25, 0, 5], [25, 3, 4], [25, 4, 3], ...
		

Crossrefs

For the y coordinates see A283306.

Programs

  • Maple
    L:=[];
    M:=30;
    for i from 0 to M do
    for j from 0 to M do
    L:=[op(L),[i^2+j^2,i,j]]; od: od:
    t4:= sort(L,proc(a,b) evalb(a[1]<=b[1]); end);
    t4x:=[seq(t4[i][2],i=1..100)]; # A283305
    t4y:=[seq(t4[i][3],i=1..100)]; # A283306
  • Mathematica
    nt = 105; (* number of terms to produce *)
    S[m_] := S[m] = Table[{x, y}, {x, 0, m}, {y, 0, m}] // Flatten[#, 1]& // SortBy[#, {#.#&, #[[1]]&}]& // #[[All, 1]]& // PadRight[#, nt]&;
    S[m = 2];
    S[m = 2m];
    While[S[m] =!= S[m/2], m = 2m];
    S[m] (* Jean-François Alcover, Mar 05 2023 *)
  • PARI
    for(r2=0,113,for(x=0,round(sqrt(r2)),y2=r2-x^2;if(issquare(y2),print1(x,", ")))) \\ Hugo Pfoertner, Jun 18 2018

A101428 Number of ways to write n as an ordered sum of a triangular number (A000217) and a square (A000290).

Original entry on oeis.org

1, 2, 1, 1, 2, 1, 1, 2, 0, 1, 3, 1, 1, 0, 1, 2, 2, 1, 0, 3, 0, 1, 2, 0, 1, 2, 2, 0, 2, 1, 1, 2, 1, 0, 0, 1, 2, 4, 0, 1, 2, 0, 1, 0, 1, 2, 3, 0, 0, 2, 1, 1, 2, 1, 1, 2, 1, 1, 0, 2, 0, 2, 0, 0, 4, 1, 1, 2, 0, 0, 4, 1, 1, 0, 1, 1, 0, 1, 1, 2, 1, 2, 3, 0, 1, 2, 0, 2, 0, 0, 0, 4, 2, 0, 2, 1, 1, 0, 0, 0, 3, 1, 2, 2, 1
Offset: 0

Views

Author

R. J. Mathar, Jan 03 2009

Keywords

Comments

0 is both a triangular number and a square number.
First occurrence of k beginning at 0: 8, 2, 1, 10, 37, 136, 235, 1549, 631, 2314, 2116, 11026, 3997, 148240, 19045, 20827, 25876, 893116, 67951, ?19?, 35974, 187444, 1542655, 354061, 131905, ?25?, ?26?, 835399, 323767, ?29?, 611560, ?31?, 515629, ?33?, ?34?, ?35?, 1187146, ?37?, ?38?, ?39?, 1474939, ..., . - Robert G. Wilson v, Mar 30 2014
Variant of A082660 (which allows only positive triangular numbers). - R. J. Mathar, Apr 28 2020
a(n) is the number of representations of 8*n + 1 as 2*A^2 + B^2 with A even and B odd and both nonnegative integers. - Vladimir Pletser, Aug 30 2025

Examples

			Examples: n=1 gives the a(1)=2 cases 1=1+0=0+1; a(26)=2 because 26=25+1=16+10.
		

Crossrefs

Programs

  • Maple
    A000217 := proc(n) n*(n+1)/2 ; end:
    A101428 := proc(n)
    local a,y,t ;
    a := 0 ;
    for y from 0 do
    t := A000217(y) ;
    if n-t < 0 then
    RETURN(a) ;
    else
    if issqr(n-t) then
    a := a+1 ;
    fi;
    fi;
    od:
    end:
    for n from 0 to 100 do printf("%a,",A101428(n)) ; od:
  • Mathematica
    t = FoldList[#1 + #2 &, 0, Range@ 15]; s = Range[0, 10]^2, a = Sort@ Flatten@ Table[ s[[j]] + t[[k]], {j, 15}, {k, 11}]; Table[Count[a, n], {n, 0, 104}] (* or *)
    triQ[n_] := IntegerQ@ Sqrt[8n + 1]; f[n_] := Block[{c = k = 0, lmt = 2 + Floor[Sqrt[n]]}, While[k < lmt, If[ triQ[n - k^2], c++]; k++]; c]; Array[f, 105, 0] (* Robert G. Wilson v, Mar 30 2014 *)

Formula

G.f.: sum(i>=0, x^(i^2) ) * sum(i>=0, x^(i*(i+1)/2) ). - Ralf Stephan, May 17 2014

A295819 Number of nonnegative solutions to (x,y) = 1 and x^2 + y^2 = n.

Original entry on oeis.org

0, 2, 1, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 4, 0, 0
Offset: 0

Views

Author

Seiichi Manyama, Nov 28 2017

Keywords

Examples

			a(1) = 2;
(1,0) = 1 and 1^2 + 0^2 =  1.
(0,1) = 1 and 0^2 + 1^2 =  1.
a(2) = 1;
(1,1) = 1 and 1^2 + 1^2 =  2. ->  1^2 +  1^2 == 1^2 + 1 == 0 mod  2.
a(5) = 2;
(2,1) = 1 and 2^2 + 1^2 =  5. ->  2^2 +  1^2 == 2^2 + 1 == 0 mod  5.
(1,2) = 1 and 1^2 + 2^2 =  5. ->  3^2 +  6^2 == 3^2 + 1 == 0 mod  5.
a(10) = 2;
(3,1) = 1 and 3^2 + 1^2 = 10. ->  3^2 +  1^2 == 3^2 + 1 == 0 mod 10.
(1,3) = 1 and 1^2 + 3^2 = 10. ->  7^2 + 21^2 == 7^2 + 1 == 0 mod 10.
a(13) = 2;
(3,2) = 1 and 3^2 + 2^2 = 13. -> 21^2 + 14^2 == 8^2 + 1 == 0 mod 13.
(2,3) = 1 and 2^2 + 3^2 = 13. -> 18^2 + 27^2 == 5^2 + 1 == 0 mod 13.
		

Crossrefs

Cf. A006278.
Similar sequences: A000010, A000925, A295820, A295848, A295976.
A000089 is essentially the same sequence.

Programs

  • Mathematica
    a[n_] := Sum[j = Sqrt[n - i^2] // Floor; Boole[GCD[i, j] == 1 && i^2 + j^2 == n], {i, 0, Sqrt[n]}];
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Jul 05 2018, after Andrew Howroyd *)
  • PARI
    a(n) = {sum(i=0, sqrtint(n), my(j=sqrtint(n-i^2)); gcd(i,j)==1 && i^2+j^2==n)} \\ Andrew Howroyd, Dec 12 2017

Formula

a(n) = A000089(n) for n >= 2.
a(A006278(n)) = 2^n for n >= 1.

A321380 Expansion of 1/2 * Product_{i>=0, j>=0} (1 + x^(i^2 + j^2)).

Original entry on oeis.org

1, 2, 2, 2, 3, 6, 8, 8, 8, 12, 19, 22, 22, 26, 37, 48, 53, 58, 72, 92, 108, 118, 136, 166, 195, 222, 254, 298, 346, 394, 453, 524, 600, 672, 762, 884, 1011, 1126, 1255, 1438, 1652, 1850, 2047, 2302, 2626, 2960, 3274, 3636, 4095, 4602, 5112, 5662, 6319, 7056, 7834
Offset: 0

Views

Author

Seiichi Manyama, Nov 08 2018

Keywords

Crossrefs

Formula

G.f.: Product_{k>0} (1 + x^k)^A000925(k).

A247367 Number of ways to write n as a sum of a square and a nonsquare.

Original entry on oeis.org

0, 0, 1, 2, 1, 1, 3, 3, 2, 2, 2, 4, 4, 2, 4, 4, 3, 3, 4, 5, 3, 5, 5, 5, 5, 2, 4, 6, 6, 4, 6, 6, 5, 6, 4, 6, 5, 5, 7, 7, 5, 5, 7, 7, 7, 5, 7, 7, 7, 6, 5, 8, 6, 6, 8, 8, 8, 8, 6, 8, 8, 6, 8, 8, 7, 5, 9, 9, 7, 9, 9, 9, 8, 7, 7, 9, 9, 9, 9, 9, 7, 8, 8, 10, 10, 6
Offset: 0

Views

Author

Reinhard Zumkeller, Sep 14 2014

Keywords

Examples

			a(10) = #{0+10, 4+6} = 2;
a(11) = #{0+11, 1+10, 4+7, 9+2} = 4;
a(12) = #{0+12, 1+11, 4+8, 9+3} = 4;
a(13) = #{0+13, 1+12} = 2;
a(14) = #{0+14, 1+13, 4+10, 9+5} = 4;
a(15) = #{0+15, 1+14, 4+11, 9+6} = 4;
a(16) = #{1+15, 4+12, 9+7} = 3;
a(17) = #{0+17, 4+13, 9+8} = 3;
a(18) = #{0+18, 1+17, 4+14, 16+2} = 4;
a(19) = #{0+19, 1+18, 4+15, 9+10, 16+3} = 5;
a(20) = #{0+20, 1+19, 9+11} = 3.
		

Crossrefs

Programs

  • Haskell
    a247367 n = sum $ map ((1 -) . a010052 . (n -)) $
                      takeWhile (<= n) a000290_list
  • Mathematica
    sQ[n_] := sQ[n] = IntegerQ[Sqrt[n]];
    a[n_] := Sum[Boole[sQ[k] && !sQ[n-k] || !sQ[k] && sQ[n-k]], {k, 0, Quotient[n, 2]}];
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Aug 10 2022 *)
Showing 1-10 of 18 results. Next