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.

A084888 Number of partitions of n^3 into two squares>0.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Jun 10 2003

Keywords

Comments

a(A050804(n)) = 1.

Examples

			n=100: 100^3 = 1000000 = 960^2 + 280^2 = 936^2 + 352^2 = 800^2 + 600^2, therefore a(100)=3.
		

Crossrefs

Programs

  • Haskell
    a084888 = a025426 . a000578  -- Reinhard Zumkeller, Jul 18 2012
    
  • PARI
    a(n)=my(f=factor(n^3)); (prod(i=1,#f~,if(f[i,1]%4==1,f[i,2]+1,f[i,2]%2==0||f[i,1]<3))-issquare(n)+1)\2 \\ Charles R Greathouse IV, May 18 2016
    
  • Python
    from math import prod
    from sympy import factorint
    def A084888(n): return ((m:=prod(1 if p==2 else (3*e+1 if p&3==1 else (3*e+1)&1) for p, e in factorint(n).items()))+((((~n**3 & n**3-1).bit_length()&1)<<1)-1 if m&1 else 0))>>1 # Chai Wah Wu, May 17 2023

Formula

a(n) = A025426(A000578(n)).