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.

User: Franklin T. Adams-Watters

Franklin T. Adams-Watters's wiki page.

Franklin T. Adams-Watters has authored 596 sequences. Here are the ten most recent ones:

A381233 Concatenate the sequences S(k) = [0, 1, -1, ..., k, -k] for k = 0, 1, ...

Original entry on oeis.org

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

Author

N. J. A. Sloane, Mar 01 2025 [Suggested by Franklin T. Adams-Watters, Sep 21 2011]

Keywords

Crossrefs

Programs

  • Mathematica
    Flatten[Table[(-1)^j*Floor[j/2], {k, 0, 10}, {j, 2*k + 1}]] (* Paolo Xausa, Mar 01 2025 *)

A381232 Count down from k to -k for k = 0, 1, 2, ... .

Original entry on oeis.org

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

Author

N. J. A. Sloane, Mar 01 2025 [Suggested by Franklin T. Adams-Watters, Sep 21 2011]

Keywords

Crossrefs

Programs

  • Mathematica
    Flatten[Table[Range[k, -k, -1], {k, 0, 10}]] (* Paolo Xausa, Mar 01 2025 *)
  • Python
    from math import isqrt
    def A381232(n): return (t:=isqrt(n))*(t+1)-n # Chai Wah Wu, Mar 01 2025

Formula

a(n) = -A196199(n) = floor(sqrt(n))*(floor(sqrt(n))+1)-n. - Chai Wah Wu, Mar 01 2025

A337717 Number of connected graphs, where vertices are labeled with positive integers summing to n, and where identically labeled vertices are indistinguishable and cannot be connected with an edge.

Original entry on oeis.org

1, 1, 1, 2, 3, 6, 12, 28, 65, 173, 496, 1527, 5092, 18669, 74601, 325206, 1572191, 8487232, 50962240, 343162568, 2627538015, 22853622935, 225118360626, 2539559186827, 33036542404276, 491977100299885, 8394837931641837
Offset: 0

Author

Max Alekseyev following a suggestion from Franklin T. Adams-Watters, Sep 16 2020

Keywords

Crossrefs

Inverse Euler transform of A337716.

A337716 Number of graphs, where vertices are labeled with positive integers summing to n, and where identically labeled vertices are indistinguishable and cannot be connected with an edge.

Original entry on oeis.org

1, 1, 2, 4, 8, 16, 35, 77, 179, 440, 1160, 3264, 9950, 33206, 121943, 494011, 2235399, 11391306, 65287199, 422908306, 3130775625, 26490210964, 255257056748, 2825013955541, 36147331371446, 531237157370531, 8965348473026888
Offset: 0

Author

Max Alekseyev following a suggestion from Franklin T. Adams-Watters, Sep 16 2020

Keywords

Crossrefs

Cf. A337717.

Programs

  • PARI
    permcount(v) = {my(m=1, s=0, k=0, t); for(i=1, #v, t=v[i]; k=if(i>1&&t==v[i-1], k+1, 1); m*=t*k; s+=t); s!/m}
    cross(u, v) = {sum(i=1, #u, sum(j=1, #v, gcd(u[i], v[j])))}
    R(n,m,u)={if(n==0, 1, sum(k=if(m==1, n, 0), n\m, my(s=0); forpart(p=k, s+=self()(n-m*k, m-1, concat(u,Vec(p)))*2^cross(p,u)*permcount(p)); s/k!))}
    a(n)={R(n,n,[])} \\ Andrew Howroyd, Sep 18 2020

A320917 a(n) = sigma_2(n)*sigma_3(n)/sigma(n).

Original entry on oeis.org

1, 15, 70, 219, 546, 1050, 2150, 3315, 5299, 8190, 13542, 15330, 26690, 32250, 38220, 51491, 79170, 79485, 124166, 119574, 150500, 203130, 268710, 232050, 330771, 400350, 419020, 470850, 684546, 573300, 895622, 811395, 947940, 1187550, 1173900, 1160481, 1826210, 1862490, 1868300, 1809990
Offset: 1

Author

Keywords

Comments

Multiplicative, because products and quotients of multiplicative functions are always multiplicative. a(p^k) for fixed k is trivially a rational function of p. The proofs below show that a(n) is always an integer, and hence a(p^k) is a polynomial in p. (Note that a(n^k) is not equal to this polynomial when n is composite.)
Proof from Robert Gerbicz that this is always an integer:
First consider r=sigma_2(p^k)/sigma(p^k). Let x=p^k, then
r=(p^(2*k+2)-1)/(p^2-1)*(p-1)/(p^(k+1)-1)=(p^2*x^2-1)/(p^2-1)*(p-1)/(p*x-1)=(p*x+1)/(p+1)
Case a: k is even, then x==1 mod (p+1), so (p*x+1)==-1+1==0 mod (p+1). So here even r is an integer.
Case b: k is odd, then
sigma_3(p^k)=(p^3*x^3-1)/(p^3-1), and we must multiple this by r, and here
p^3*x^3-1==0 mod (p+1)
p^3-1==-2 mod (p+1)
This means that if p=2 then sigma_3(p^k) is divisible by (p+1), so we have proved the theorem.
If p is odd, then (p+1)/2 divides sigma_3(p^k), but we have another factor of 2 in (p*x+1), because p and x is odd.
It appears that a stronger result is also true: sigma_3(p^k) is divisible by (p+1) if k is odd.
Proof from Giovanni Resta that this is always an integer:
We have sigma_2(p^k)*sigma_3(p^k)/sigma(p^k) =
((p^(2+2*k)-1)/(p^2-1) * (p^(3+3*k)-1)/(p^3-1)) / ((p^(1+k)-1)/(p-1)) =
((p^(k+1)+1)*(p^(3*k+3)-1)) / ((p+1)*(p^3-1)),
because p^(2+2*k)-1 is the difference of two squares and we can use x^2-1 = (x+1)*(x-1).
We observe that p^(3*k+3)-1 is always divisible by p^3-1 (it is indeed sigma_3(p^k)).
Now, if k is even, k+1 is odd, so p^(k+1)+1 is divisible by p+1 giving 1-p+p^2-p^3... +p^k as result, and we are done.
If k is odd, k+1 is even and in general p^(k+1)+1 is not divisible by p+1 (just as p^2+1 is not divisible by p+1).
However, if k is odd, then 3*k+3 is even, so p^(3*k+3)-1 beside being divisible by p^3-1 is also divisible by p+1. Since p+1 and p^3-1 have no common factors, then the ratio (p^(3*k+3)-1) / ((p+1)*(p^3-1)) is an integer and we are done.

Crossrefs

Programs

  • Mathematica
    a[n_] := DivisorSigma[2, n] * DivisorSigma[3, n] / DivisorSigma[1, n]; Array[a, 40] (* Amiram Eldar, Aug 01 2019 *)
    (#[[2]]#[[3]])/#[[1]]&/@Table[DivisorSigma[k,n],{n,40},{k,3}] (* Harvey P. Dale, Aug 14 2024 *)
  • PARI
    a(n) = sigma(n,2)*sigma(n,3)/sigma(n)

Formula

a(n) = sigma_2(n)*sigma_3(n)/sigma(n).
Sum_{k=1..n} a(k) ~ c * n^5, where c = (Pi^6*zeta(5)/2700) * Product_{p prime} (1 - 2/p^2 + 2/p^3 - 2/p^4 + 1/p^6) = 0.1662831668... . - Amiram Eldar, Dec 01 2022

A320059 Sum of divisors of n^2 that do not divide n.

Original entry on oeis.org

0, 4, 9, 24, 25, 79, 49, 112, 108, 199, 121, 375, 169, 375, 379, 480, 289, 808, 361, 919, 709, 895, 529, 1591, 750, 1239, 1053, 1711, 841, 2749, 961, 1984, 1681, 2095, 1719, 3660, 1369, 2607, 2323, 3847, 1681, 5091, 1849, 4039, 3673, 3799, 2209, 6519, 2744, 5374
Offset: 1

Author

Keywords

Comments

sigma(n^2) is always odd, so this sequence has the opposite parity from sigma(n): even if n is a square or twice a square, odd otherwise.

Crossrefs

Programs

  • Magma
    [DivisorSigma(1, n^2) - DivisorSigma(1, n): n in [1..70]]; // Vincenzo Librandi, Oct 05 2018
    
  • Maple
    map(n -> numtheory:-sigma(n^2)-numtheory:-sigma(n), [$1..100]); # Robert Israel, Oct 04 2018
  • Mathematica
    Table[DivisorSigma[1, n^2] - DivisorSigma[1, n], {n, 70}] (* Vincenzo Librandi, Oct 05 2018 *)
  • PARI
    a(n) = sigma(n^2)-sigma(n)
    
  • Python
    from _future_ import division
    from sympy import factorint
    def A320059(n):
        c1, c2 = 1, 1
        for p, a in factorint(n).items():
            c1 *= (p**(2*a+1)-1)//(p-1)
            c2 *= (p**(a+1)-1)//(p-1)
        return c1-c2 # Chai Wah Wu, Oct 05 2018

Formula

a(n) = sigma(n^2) - sigma(n).
a(n) = A065764(n) - A000203(n).
a(n) = n^2 iff n is prime. - Altug Alkan, Oct 04 2018

A298734 a(n) = n-th term in periodic sequence repeating the divisors of n in decreasing order.

Original entry on oeis.org

1, 1, 3, 4, 5, 3, 7, 1, 1, 5, 11, 1, 13, 7, 3, 16, 17, 1, 19, 10, 21, 11, 23, 1, 25, 13, 3, 4, 29, 3, 31, 16, 33, 17, 5, 1, 37, 19, 3, 1, 41, 21, 43, 22, 9, 23, 47, 3, 49, 25, 3, 4, 53, 3, 5, 1, 57, 29, 59, 1, 61, 31, 9, 64, 65, 33, 67, 34, 69, 5, 71, 1, 73, 37, 15, 4, 77, 3, 79, 1, 81, 41, 83, 1, 85, 43, 3, 1, 89, 10, 7, 46, 93, 47
Offset: 1

Author

Keywords

Examples

			The divisors of 6 are 1, 2, 3, 6, which reversed is 6,3,2,1; repeating that produces the sequence 6, 3, 2, 1, 6, 3, 2, 1, 6, 3, 2, 1, ...; the 6th term in that sequence is 3, so a(6) = 3.
		

Crossrefs

Cf. A122377 (n/a(n)), A033950 (indices of 1's).

Programs

  • Maple
    with(numtheory):
    a:= n-> n/(l-> l[1+irem(n-1, nops(l))])(sort([divisors(n)[]])):
    seq(a(n), n=1..100);  # Alois P. Heinz, Jan 29 2018
  • Mathematica
    Table[PadRight[{},n,Reverse[Divisors[n]]][[-1]],{n,100}] (* Harvey P. Dale, Jul 21 2024 *)
  • PARI
    a(n) = my(d=Vecrev(divisors(n))); if (n % #d, d[n % #d], 1); \\ Michel Marcus, Jan 26 2018

A295218 Number of partitions of 2*n-1 into four squares.

Original entry on oeis.org

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

Author

Keywords

Comments

This is a bisection of A002635.
While A002635 contains each positive integer infinitely often, here a number can appear only finitely many times.
By the Jacobi theorem, a(n) >= A000203(n)/48 >= (1+n)/48, which implies the previous comment. - Robert Israel, Nov 21 2017

Crossrefs

Programs

  • Maple
    N:= 100: # to get a(1)...a(N)
    V:= Array(0..2*N-1):
    for a from 0 while 4*a^2 <= 2*N-1 do
      for b from a while a^2 + 3*b^2 <= 2*N-1 do
         for c from b while a^2 + b^2 + 2*c^2 <= 2*N-1 do
           for d from c while a^2 + b^2 + c^2 + d^2 <= 2*N-1 do
             t:= a^2 + b^2 + c^2 + d^2;
             V[t]:= V[t]+1
    od od od od:
    seq(V[2*i-1],i=1..N); # Robert Israel, Nov 21 2017

A289276 Numbers k such that phi(k) (the totient function A000010) is a power of the number of divisors of k (A000005).

Original entry on oeis.org

1, 2, 3, 5, 8, 10, 17, 18, 24, 30, 34, 63, 76, 85, 128, 136, 170, 257, 315, 333, 364, 380, 436, 444, 514, 640, 680, 972, 1285, 1542, 1820, 1824, 1836, 1875, 2142, 2220, 2907, 3285, 3488, 3796, 4369, 4788, 4860
Offset: 1

Author

Keywords

Comments

A019434 is a subsequence. - David A. Corneth, Jun 30 2017
Is the frequency of e such that A000005(a(n))^e = A000010(a(n)) finite? - David A. Corneth, Jul 01 2017

Programs

  • Mathematica
    Join[{1},Select[Range[2,5000],IntegerQ[Log[DivisorSigma[0,#],EulerPhi[#]]]&]] (* Harvey P. Dale, Aug 06 2017 *)
  • PARI
    ispowerof(n, k)= if(k==1, return(n==1)); while(n>=k, if(n%k!=0, return(0)); n\=k); n==1
    isa(n) = ispowerof(eulerphi(n),numdiv(n)) \\ Quick program, fast enough for early values.
    
  • PARI
    is(n) = if(n==1, return(1)); my(f = factor(n); phi = eulerphi(f), ndiv = numdiv(f), e = logint(phi, ndiv)); ndiv^e == phi \\ David A. Corneth, Jun 30 2017, changed per suggestion of Charles R Greathouse IV
    
  • PARI
    isA289276(n)= if(n==1, return(1)); my(phi = eulerphi(n), ndiv = numdiv(n), v = valuation(phi, ndiv)); ndiv^v == phi; \\ (A variant of above program). - Antti Karttunen, Jun 30 2017
    
  • PARI
    list(lim)=my(v=List([1])); forfactored(n=2,lim\1, my(phi = eulerphi(n), ndiv = numdiv(n)); if(ndiv^valuation(phi,ndiv) == phi, listput(v,n[1]))); Vec(v) \\ Charles R Greathouse IV, Jul 01 2017

A288574 Total number of distinct primes in all representations of 2*n+1 as a sum of 3 odd primes.

Original entry on oeis.org

0, 0, 0, 0, 1, 2, 4, 4, 6, 7, 9, 10, 12, 15, 17, 16, 19, 19, 23, 25, 26, 26, 28, 33, 32, 35, 43, 39, 41, 45, 45, 48, 54, 55, 52, 60, 59, 56, 75, 67, 67, 81, 74, 76, 92, 83, 85, 100, 96, 81, 106, 103, 91, 121, 108, 98, 131, 120, 116, 143, 133, 129, 151, 144, 124, 163
Offset: 0

Author

Keywords

Comments

That is, a representation 2n+1 = p+p+p counts as 1, as p+p+q counts as 2, and p+q+r counts as 3. If each representation is counted once, we simply get A007963.

Crossrefs

A288573 appears to be an erroneous version of this sequence.

Programs

  • Maple
    A288574 := proc(n)
        local a, i, j, k, p, q, r,pqr ;
        a := 0 ;
        for i from 2 do
            p := ithprime(i) ;
            for j from i do
                q := ithprime(j) ;
                for k from j do
                    r := ithprime(k) ;
                    if p+q+r = 2*n+1 then
                        pqr := {p,q,r} ;
                        a := a+nops(pqr) ;
                    elif p+q+r > 2*n+1 then
                        break;
                    end if;
                end do:
                if p+2*q > 2*n+1 then
                    break;
                end if;
            end do:
            if 3*p > 2*n+1 then
                break;
            end if;
        end do:
        return a;
    end proc:
    seq(A288574(n),n=0..80) ; # R. J. Mathar, Jun 29 2017
  • Mathematica
    Table[x = 2 n + 1; max = PrimePi[x]; Total[Length /@ Tally /@ DeleteDuplicates[Sort /@ Select[Tuples[Range[2, max], 3], Prime[#[[1]]] + Prime[#[[2]]] + Prime[#[[3]]] == x &]]], {n, 0, 100}] (* Robert Price, Apr 22 2025 *)
  • PARI
    a(n)={my(p,q,r,cnt);n=2*n+1;
    forprime(p=3,n\3,forprime(q=p,(n-p)\2,
    if(isprime(r=n-p-q), cnt+=if(p===q&&p==r,1,if(p==q||q==r,2,3)))));cnt}
    \\ Franklin T. Adams-Watters, Jun 28 2017
    
  • Python
    from sympy import primerange, isprime
    def a(n):
        n=2*n + 1
        c=0
        for p in primerange(3, n//3 + 1):
            for q in primerange(p, (n - p)//2 + 1):
                r=n - p - q
                if isprime(r): c+=1 if p==q and p==r else 2 if p==q or q==r else 3
        return c
    print([a(n) for n in range(66)]) # Indranil Ghosh, Jun 29 2017