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 21 results. Next

A005171 Characteristic function of nonprimes: 0 if n is prime, else 1.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Number of orbits of length n in map whose periodic points are A023890. - Thomas Ward
Characteristic function of nonprimes A018252. - Jonathan Vos Post, Dec 30 2007
Triangle A157423 = A005171 in every column. A052284 = INVERT transform of A005171, and the eigensequence of triangle A157423. - Gary W. Adamson, Feb 28 2009

References

  • Douglas Hofstadter, Fluid Concepts and Creative Analogies: Computer Models of the Fundamental Mechanisms of Thought.

Crossrefs

Programs

  • Haskell
    a005171 = (1 -) . a010051  -- Reinhard Zumkeller, Mar 30 2014
    
  • Maple
    A005171 := proc(n)
        if isprime(n) then
            0 ;
        else
            1 ;
        end if;
    end proc: # R. J. Mathar, May 26 2017
  • Mathematica
    a[n_] := If[PrimeQ@ n, 0, 1]; Array[a, 105] (* Robert G. Wilson v, Jun 20 2011 *)
    nn = 105; t[n_, k_] :=  t[n, k] = If[n == k, 1, If[k == 1, 1 - Product[t[n, k + i], {i, 1, n - 1}], If[Mod[n, k] == 0, t[n/k, 1], 1], 1]]; Table[t[n, 1], {n, 1, nn}] (* Mats Granvik, Sep 21 2013 *)
  • PARI
    a(n)=if(n<1, 0, !isprime(n)) /* Michael Somos, Jun 08 2005 */
    
  • Python
    from sympy import isprime
    def a(n): return int(not isprime(n))
    print([a(n) for n in range(1, 106)]) # Michael S. Branicky, Oct 28 2021

Formula

a(n) = (1/n)* Sum_{ d divides n } mu(d)*A023890(n/d). E.g., a(6) = 1 since the 6th term of A023890 is 7 and the first term is 1. [edited by Michel Marcus, Dec 14 2023]
a(n) = 1 - A010051(n). - Jonathan Vos Post, Dec 30 2007
a(n) equals the first column in a table T defined by the recurrence: If n = k then T(n,k) = 1 else if k = 1 then T(n,k) = 1 - Product_{k divides n} of T(n,k), else if k divides n then T(n,k) = T(n/k,1). This is true since T(n,k) = 0 when k divides n and n/k is prime which results in Product_{k divides n} = 0 for the composite numbers and where k ranges from 2 to n. Therefore there is a remaining 1 in the expression 1-Product_{k divides n}, in the first column. Provided below is a Mathematica program as an illustration. - Mats Granvik, Sep 21 2013
a(n) = A057427(A239968(n)). - Reinhard Zumkeller, Mar 30 2014
a(n) = Sum_{d|n} A033273(d)*A008683(n/d). - Ridouane Oudra, Jul 03 2025

A023891 Sum of composite divisors of n.

Original entry on oeis.org

0, 0, 0, 4, 0, 6, 0, 12, 9, 10, 0, 22, 0, 14, 15, 28, 0, 33, 0, 34, 21, 22, 0, 54, 25, 26, 36, 46, 0, 61, 0, 60, 33, 34, 35, 85, 0, 38, 39, 82, 0, 83, 0, 70, 69, 46, 0, 118, 49, 85, 51, 82, 0, 114, 55, 110, 57, 58, 0, 157, 0, 62, 93, 124, 65, 127, 0, 106, 69, 129, 0
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Array[ Plus @@ (Select[ Divisors[ # ], (!PrimeQ[ # ] && #>1)& ])&, 75 ]
    a[n_] := DivisorSigma[1, n] - Plus @@ FactorInteger[n][[;; , 1]] - 1; a[1] = 0; Array[a, 100] (* Amiram Eldar, Jun 20 2022 *)
  • PARI
    a(n) = sumdiv(n, d, d*!isprime(d)) - 1; \\ Michel Marcus, Jun 12 2019

Formula

a(n) = A023890(n) - 1. - Sean A. Irvine, Jun 11 2019

A087652 Product of the nonprime divisors of n.

Original entry on oeis.org

1, 1, 1, 4, 1, 6, 1, 32, 9, 10, 1, 288, 1, 14, 15, 512, 1, 972, 1, 800, 21, 22, 1, 55296, 25, 26, 243, 1568, 1, 27000, 1, 16384, 33, 34, 35, 1679616, 1, 38, 39, 256000, 1, 74088, 1, 3872, 6075, 46, 1, 42467328, 49, 12500, 51, 5408, 1, 1417176, 55, 702464, 57, 58
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 25 2003

Keywords

Examples

			For n = 12: nonprime divisors = {4,6,12}: a(12) = 4*6*12 = 288.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := n^(DivisorSigma[0, n]/2) / Times @@ FactorInteger[n][[;;, 1]]; Array[a, 100] (* Amiram Eldar, Feb 01 2025 *)
  • PARI
    a(n) = my(p=1); fordiv(n, d, if (!isprime(d), p*=d)); p; \\ Michel Marcus, Aug 05 2017

Formula

a(n) = 1 if n = 1 or n is prime.
a(n) = n if n = 1 or n is semiprime (A001358).
From Wesley Ivan Hurt, Jun 08 2020: (Start)
a(n) = Product_{d|n, d nonprime} d.
If n is squarefree, then a(n) = n^(d(n)/2-1), where d(n) is the number of divisors of n (A000005). (End)
a(p^e) = p^((e^2+e-2)/2) for p prime, e > 0. - Bernard Schott, Jun 08 2020
a(n) = A007955(n)/A007947(n). - Amiram Eldar, Feb 01 2025

A333751 Sum of nonprime divisors of n that are <= sqrt(n).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 1, 1, 5, 1, 1, 1, 5, 1, 1, 1, 5, 1, 1, 1, 5, 1, 1, 1, 11, 1, 1, 1, 5, 1, 7, 1, 5, 1, 1, 1, 11, 1, 1, 1, 5, 1, 7, 1, 5, 1, 1, 1, 11, 1, 1, 1, 13, 1, 7, 1, 5, 1, 1, 1, 19, 1, 1, 1, 5, 1, 7, 1, 13, 10, 1, 1, 11, 1, 1, 1, 13, 1, 16
Offset: 1

Views

Author

Ilya Gutkovskiy, Apr 03 2020

Keywords

Crossrefs

Programs

  • Maple
    f:= proc(n) convert(select(t -> not isprime(t) and t^2 <= n, numtheory:-divisors(n)),`+`) end proc:
    map(f, [$1..100]); # Robert Israel, Sep 12 2024
  • Mathematica
    Table[DivisorSum[n, # &, # <= Sqrt[n] && !PrimeQ[#] &], {n, 1, 90}]
    nmax = 90; CoefficientList[Series[Sum[Boole[!PrimeQ[k]] k x^(k^2)/(1 - x^k), {k, 1, nmax}], {x, 0, nmax}], x] // Rest
  • PARI
    a(n) = sumdiv(n, d, if ((d^2<=n) && !isprime(d), d)); \\ Michel Marcus, Apr 03 2020

Formula

G.f.: Sum_{k>=1} A018252(k) * x^(A018252(k)^2) / (1 - x^A018252(k)).

A087802 a(n) = Sum_{d|n, d nonprime} mu(d), where mu = A008683.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 2, 1, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 1, 2, 2, 2, 2, 1, 2, 2, 2, 1, 3, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 1, 3, 1, 2, 2, 1, 2, 3, 1, 2, 2, 3, 1, 2, 1, 2, 2, 2, 2, 3, 1, 2, 1, 2, 1, 3, 2, 2, 2, 2, 1, 3, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 1, 3
Offset: 1

Views

Author

Reinhard Zumkeller, Oct 11 2003

Keywords

Comments

A064372 and this sequence first differ at term 64: A064372(64)=2 and a(64)=1. - Rick L. Shepherd, Mar 07 2004

Examples

			Divisors of n=42: {1,2,3,6,7,14,21,42}, a(42) = mu(1) + mu(6) + mu(14) + mu(21) + mu(42) = 1+1+1+1-1 = 3.
		

Crossrefs

Cf. A001221, A008683 (mu), A023890, A033273. Different from A079553.

Programs

  • Mathematica
    Table[Total[MoebiusMu[#]&/@Select[Divisors[n],!PrimeQ[#]&]],{n,120}] (* Harvey P. Dale, Oct 14 2014 *)
  • PARI
    A087802(n) = sumdiv(n,d,if(!isprime(d),moebius(d)))

Formula

a(n) = if n=1 then 1, else A001221(n). - Vladeta Jovovic, Oct 17 2003

A194594 Numbers such that the sum of the their nonprime divisors and the sum of their prime divisors are both primes.

Original entry on oeis.org

4, 6, 8, 10, 12, 16, 22, 27, 32, 40, 44, 58, 68, 80, 82, 88, 116, 125, 136, 164, 165, 176, 192, 232, 236, 250, 256, 284, 328, 352, 358, 382, 420, 428, 435, 462, 472, 478, 486, 512, 548, 562, 640, 651, 656, 665, 704, 714, 764, 768, 788, 798, 808, 819, 838
Offset: 1

Views

Author

Michel Lagneau, Aug 30 2011

Keywords

Examples

			The divisors of 136 are { 1, 2, 4, 8, 17, 34, 68, 136 }, the sum of its nonprime divisors is 1 + 4 + 8 + 34 + 68 + 136 = 251 is prime, and the sum of its prime divisors is 2 + 17 = 19 is prime, hence 136 is in the sequence.
		

Crossrefs

Programs

  • Mathematica
    f[n_]:=Plus@@Select[Divisors[n],!PrimeQ[#]&];g[n_]:=Plus@@First/@FactorInteger[n];Select[Range[1000],PrimeQ[f[#]&&PrimeQ[g[#]]]&]
    ndpdQ[n_]:=Module[{d=Divisors[n],pr},pr=Select[d,PrimeQ];AllTrue[ {Total[ pr],Total[Complement[d,pr]]},PrimeQ]]; Select[Range[900],ndpdQ] (* Harvey P. Dale, Sep 23 2021 *)
  • PARI
    isok(n) = isprime(s=sumdiv(n, d, if (isprime(d), d))) && isprime(sigma(n)-s); \\ Michel Marcus, Jan 07 2020

A189120 Sum of squares of nonprime divisors of n.

Original entry on oeis.org

1, 1, 1, 17, 1, 37, 1, 81, 82, 101, 1, 197, 1, 197, 226, 337, 1, 442, 1, 517, 442, 485, 1, 837, 626, 677, 811, 997, 1, 1262, 1, 1361, 1090, 1157, 1226, 1898, 1, 1445, 1522, 2181, 1, 2438, 1, 2437, 2332, 2117, 1, 3397, 2402, 3226, 2602, 3397, 1, 4087, 3026, 4197, 3250, 3365
Offset: 1

Views

Author

Jonathan Vos Post, Apr 17 2011

Keywords

Comments

a(p) = 1 for p prime.

Examples

			a(12) = 197 because the divisors of 12 are {1, 2, 3, 4, 6, 12}, the subset of nonprime divisors are {1, 4, 6, 12}, and 1^2 + 4^2 + 6^2 + 12^2 = 197.
		

Crossrefs

Cf. A023890 (sum of the nonprime divisors of n).

Programs

  • Maple
    A189120 := proc(n) local a,d; a := 0 ; for d in numtheory[divisors](n) do if not isprime(d) then a := a+d^2 ; end if; end do: a ; end proc: # R. J. Mathar, Apr 17 2011
  • Mathematica
    Table[Total[Select[Divisors[n], ! PrimeQ[#] &]^2], {n, 50}]

Formula

a(n) = Sum_{k|n, k not prime} k^2.
G.f.: Sum_{k>=1} k^2*x^(k+1)/(1 - x^k) - prime(k)^2*x^(prime(k)+1)/(1 - x^prime(k)). - Ilya Gutkovskiy, Jan 01 2017
a(n) = A001157(n) - A005063(n). - Wesley Ivan Hurt, Sep 04 2022

A194039 Sum of nonprime divisors of n^2 + 1.

Original entry on oeis.org

1, 1, 11, 1, 27, 1, 86, 66, 83, 1, 123, 146, 300, 1, 227, 1, 504, 416, 363, 1, 724, 486, 912, 1, 627, 1, 1252, 786, 843, 902, 1544, 1256, 1864, 1158, 1227, 1, 2340, 1820, 1523, 1, 2582, 1766, 3490, 1938, 2027, 2118, 4499, 2306, 2403, 2502, 2603, 2706
Offset: 1

Views

Author

Michel Lagneau, Aug 12 2011

Keywords

Examples

			a(3) = 11 because 3^2 + 1 =  10 with the divisors {1, 2, 5, 10}, and the sum of the nonprime divisors is 1 + 10 = 11.
		

Programs

  • Mathematica
    Array[ Plus @@ (Select[ Divisors[#^2+1],(!PrimeQ[#])& ])&, 75 ]

Formula

a(n) = A023890(n^2 + 1). - R. J. Mathar, Aug 14 2011

A206773 Sum of nonprime proper divisors (or nonprime aliquot parts) of n.

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 1, 5, 1, 1, 1, 11, 1, 1, 1, 13, 1, 16, 1, 15, 1, 1, 1, 31, 1, 1, 10, 19, 1, 32, 1, 29, 1, 1, 1, 50, 1, 1, 1, 43, 1, 42, 1, 27, 25, 1, 1, 71, 1, 36, 1, 31, 1, 61, 1, 55, 1, 1, 1, 98, 1, 1, 31, 61, 1, 62, 1, 39, 1, 60, 1, 118, 1, 1, 41, 43, 1
Offset: 1

Views

Author

Michel Lagneau, Jan 10 2013

Keywords

Comments

Sum of nonprime divisors of n that are less than n.
a(n) = 1 if n is prime or semiprime.
Up to 3*10^12, a(n) = n only for n = 42, 1316, and 131080256. In general, if p = 2^k-1 and q = 4^k-2*2^k-1 are two primes, then n = 2^(k-1)*p*q satisfies a(n) = n. This happens for k= 2, 3, 7, and 19, which give the aforementioned values and 3777871569031248714137. This property makes these values terms of A225028. - Giovanni Resta, May 03 2016

Crossrefs

Programs

  • Maple
    with(numtheory):for n from 1  to 100 do:x:=factorset(n):n1:=nops(x):s:=sum('x[i] ', 'i'=1..n1): s1:=sigma(n)-s-n: if type(n,prime)=true then printf(`%d, `,1) else printf(`%d, `,s1):fi:od:
  • Mathematica
    Table[Plus@@Select[Divisors[n],#Giovanni Resta, May 03 2016 *)

Formula

a(n) = A001065(n) - A105221(n)

A300893 L.g.f.: log(Product_{k>=1} (1 + x^k)/(1 + x^prime(k))) = Sum_{n>=1} a(n)*x^n/n.

Original entry on oeis.org

1, -1, 1, 3, 1, 5, 1, 3, 10, 9, 1, 9, 1, 13, 16, 3, 1, 14, 1, 13, 22, 21, 1, 9, 26, 25, 37, 17, 1, 30, 1, 3, 34, 33, 36, 18, 1, 37, 40, 13, 1, 40, 1, 25, 70, 45, 1, 9, 50, 34, 52, 29, 1, 41, 56, 17, 58, 57, 1, 34, 1, 61, 94, 3, 66, 60, 1, 37, 70, 58, 1, 18, 1, 73, 116, 41, 78, 70, 1, 13, 118, 81, 1, 44, 86
Offset: 1

Views

Author

Ilya Gutkovskiy, Mar 14 2018

Keywords

Examples

			L.g.f.: L(x) = x - x^2/2 + x^3/3 + 3*x^4/4 + x^5/5 + 5*x^6/6 + x^7/7 + 3*x^8/8 + 10*x^9/9 + 9*x^10/10 + ...
exp(L(x)) = 1 + x + x^4 + x^5 + x^6 + x^7 + x^8 + 2*x^9 + 3*x^10 + ... + A096258(n)*x^n + ...
		

Crossrefs

Programs

  • Mathematica
    nmax = 85; Rest[CoefficientList[Series[Log[Product[(1 + x^k)/(1 + x^Prime[k]), {k, 1, nmax}]], {x, 0, nmax}], x] Range[0, nmax]]
    nmax = 85; Rest[CoefficientList[Series[Sum[Boole[!PrimeQ[k]] k x^k/(1 + x^k), {k, 1, nmax}], {x, 0, nmax}], x]]
    Table[DivisorSum[n, (-1)^(n/# + 1) # &, !PrimeQ[#] &], {n, 85}]

Formula

G.f.: Sum_{k>=1} A018252(k)*x^A018252(k)/(1 + x^A018252(k)).
a(n) = 1 if n is an odd prime or 1 (A006005).
Showing 1-10 of 21 results. Next