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 10 results.

A140706 A054525 * A014683; a(n) = Sum_{d|n} mu(d)*A014683(n/d).

Original entry on oeis.org

1, 2, 3, 1, 5, 0, 7, 4, 5, 2, 11, 5, 13, 4, 6, 8, 17, 7, 19, 9, 10, 8, 23, 8, 19, 10, 18, 13, 29, 11, 31, 16, 18, 14, 22, 12, 37, 16, 22, 16, 41, 15, 43, 21, 25, 20, 47, 16, 41, 21, 30, 25, 53, 18, 38, 24, 34, 26, 59, 15, 61, 28, 37, 32, 46, 23, 67, 33, 42, 27, 71, 24, 73, 34, 41
Offset: 1

Views

Author

Gary W. Adamson, May 24 2008

Keywords

Comments

a(n) = n iff n is prime.

Examples

			a(4) = 1 = (0, -1, 0, 1) dot (1, 3, 4, 4), where (0, -1, 0, 1) = row 4 of triangle A054525.
		

Crossrefs

Programs

  • Maple
    read("transforms") : A014683 := proc(n) if isprime(n) then 1+n; else n; fi; end: a014683 := [seq(A014683(n),n=1..150)] ; a140706 := MOBIUS(a014683) ; for i from 1 to nops(a140706) do printf("%d,",op(i,a140706)) ; od: # R. J. Mathar, Jan 19 2009
  • Mathematica
    Table[Sum[MoebiusMu[d] (# + Boole@ PrimeQ@ #) &[n/d], {d, Divisors@ n}], {n, 75}] (* Michael De Vlieger, Jul 29 2017 *)
  • PARI
    A014683(n) = (n+isprime(n));
    A140706(n) = sumdiv(n,d,moebius(d)*A014683(n/d)); \\ Antti Karttunen, Jul 28 2017
    
  • Python
    from sympy import isprime, mobius, divisors
    def a014683(n): return n + isprime(n)
    def a140706(n): return sum(mobius(d)*a014683(n//d) for d in divisors(n))
    print([a140706(n) for n in range(1,51)]) # Indranil Ghosh, Jul 29 2017

Formula

Möbius transform of A014683: (1, 3, 4, 4, 6, 6, 8, 8, 9, 10, ...); where A014683(n) = n if n is not prime; but (n+1) if n is prime.
a(n) = Sum_{d|n} A008683(d)*A014683(n/d), where A008683 is Moebius mu function. - Antti Karttunen, Jul 28 2017

Extensions

More terms from R. J. Mathar, Jan 19 2009
Second part added to the name by Antti Karttunen, Jul 28 2017

A000086 Number of solutions to x^2 - x + 1 == 0 (mod n).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Number of elliptic points of order 3 for Gamma_0(n).
Equivalently, number of fixed points of Gamma_0(n) of type rho.
Values are 0 or a power of 2.
Shadow transform of central polygonal numbers A002061. - Michel Marcus, Jun 06 2013
Empirical: a(n) == A001615(n) (mod 3) for all natural numbers n. - John M. Campbell, Apr 01 2018
From Jianing Song, Jul 03 2018: (Start)
The comment above is true. Since both a(n) and A001615(n) are multiplicative we just have to verify that for prime powers. Note that A001615(p^e) = (p+1)*p^(e-1). For p == 1 (mod 3), p+1 == 2 (mod 3) so (p+1)*p^(e-1) == 2 (mod 3); for p == 2 (mod 3), p+1 is a multiple of 3 so (p+1)*p^(e-1) == 0 (mod 3). For p = 3, if e = 1 then p+1 == 1 (mod 3); if e > 1 then (p+1)*p^(e-1) == 0 (mod 3).
Equivalently, number of solutions to x^2 + x + 1 == 0 (mod n). (End)

Examples

			G.f. = x + x^3 + 2*x^7 + 2*x^13 + 2*x^19 + 2*x^21 + 2*x^31 + 2*x^37 + 2*x^39 + ...
		

References

  • Bruno Schoeneberg, Elliptic Modular Functions, Springer-Verlag, NY, 1974, p. 101.
  • Goro Shimura, Introduction to the Arithmetic Theory of Automorphic Functions, Princeton, 1971, see p. 25, Eq. (3).

Crossrefs

Cf. A341422 (without zeros).

Programs

  • Haskell
    a000086 n = if n `mod` 9 == 0 then 0
      else product $ map ((* 2) . a079978 . (+ 2)) $ a027748_row $ a038502 n
    -- Reinhard Zumkeller, Jun 23 2013
  • Maple
    with(numtheory); A000086 := proc (n) local d, s; if modp(n,9) = 0 then RETURN(0) fi; s := 1; for d in divisors(n) do if isprime(d) then s := s*(1+eval(legendre(-3,d))) fi od; s end: # Gene Ward Smith, May 22 2006
  • Mathematica
    Array[ Function[ n, If[ EvenQ[ n ] || Mod[ n, 9 ]==0, 0, Count[ Array[ Mod[ #^2-#+1, n ]&, n, 0 ], 0 ] ] ], 84 ]
    a[ n_] := If[ n < 1, 0, Length[ Select[ (#^2 - # + 1)/n & /@ Range[n], IntegerQ]]]; (* Michael Somos, Aug 14 2015 *)
    a[n_] := a[n] = Product[{p, e} = pe; Which[p==1 || p==3 && e==1, 1, p==3 && e>1, 0, Mod[p, 3]==1, 2, Mod[p, 3]==2, 0, True, a[p^e]], {pe, FactorInteger[n]}]; Array[a, 105] (* Jean-François Alcover, Oct 18 2018 *)
  • PARI
    {a(n) = if( n<1, 0, sum( x=0, n-1, (x^2 - x + 1)%n==0))}; \\ Nov 15 2002
    
  • PARI
    {a(n) = if( n<1, 0, direuler( p=2, n, if( p==3, 1 + X, if( p%3==2, 1, (1 + X) / (1 - X)))) [n])}; \\ Nov 15 2002
    

Formula

Multiplicative with a(p^e) = 1 if p = 3 and e = 1; 0 if p = 3 and e > 1; 2 if p == 1 (mod 3); 0 if p == 2 (mod 3). - David W. Wilson, Aug 01 2001
a(A226946(n)) = 0; a(A034017(n)) > 0. - Reinhard Zumkeller, Jun 23 2013
a(2*n) = a(3*n + 2) = a(9*n) = a(9*n + 6) = 0. - Michael Somos, Aug 14 2015
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 2*sqrt(3)/(3*Pi) = 0.367552... (A165952). - Amiram Eldar, Oct 11 2022

A113646 a(n) is the smallest composite integer which is >= n.

Original entry on oeis.org

4, 4, 4, 4, 6, 6, 8, 8, 9, 10, 12, 12, 14, 14, 15, 16, 18, 18, 20, 20, 21, 22, 24, 24, 25, 26, 27, 28, 30, 30, 32, 32, 33, 34, 35, 36, 38, 38, 39, 40, 42, 42, 44, 44, 45, 46, 48, 48, 49, 50, 51, 52, 54, 54, 55, 56, 57, 58, 60, 60, 62, 62, 63, 64, 65, 66, 68, 68, 69, 70, 72, 72
Offset: 1

Views

Author

Leroy Quet, Jan 15 2006

Keywords

Crossrefs

Programs

  • Haskell
    a113646 n = if n < 3 then 4 else a014683 n
    -- Reinhard Zumkeller, Nov 01 2014
    
  • Maple
    # This Maple program returns the smallest composite greater than n - N. J. A. Sloane, Sep 11 2019
    iscomp := n-> if isprime(n) or (n=1) then false else true; fi;
    f := proc(n) local a; global iscomp; a:=n+1; while not iscomp(a) do a:=a+1; od; a; end;
  • Mathematica
    Table[k = n; While[! CompositeQ@ k, k++]; k, {n, 72}] (* Michael De Vlieger, Sep 06 2017 *)
  • Python
    from sympy import isprime
    def a(n):
      an = max(4, n)
      while isprime(an): an += 1
      return an
    print([a(n) for n in range(1, 73)]) # Michael S. Branicky, Apr 04 2021
    
  • Python
    from sympy import isprime
    def A113646(n): return n+isprime(n) if n>2 else 4 # Chai Wah Wu, Oct 03 2024

Formula

a(1) = a(2) = 4. For n >= 3, a(n) = A014683(n).

A135681 a(n)=n if n=1 or if n=prime. Otherwise, n=4 if n is even and n=1 if n is odd.

Original entry on oeis.org

1, 2, 3, 4, 5, 4, 7, 4, 1, 4, 11, 4, 13, 4, 1, 4, 17, 4, 19, 4, 1, 4, 23, 4, 1, 4, 1, 4, 29, 4, 31, 4, 1, 4, 1, 4, 37, 4, 1, 4, 41, 4, 43, 4, 1, 4, 47, 4, 1, 4, 1, 4, 53, 4, 1, 4, 1, 4, 59, 4, 61, 4, 1, 4, 1, 4, 67, 4, 1, 4, 71, 4, 73
Offset: 1

Views

Author

Mohammad K. Azarian, Dec 01 2007

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := If[PrimeQ[n] || n == 1, n, If[EvenQ[n], 4, 1] ]; Table[a[n], {n,1,25}] (* G. C. Greubel, Oct 26 2016 *)

A113636 In the sequence of positive integers add 1 to each nonprime number.

Original entry on oeis.org

2, 2, 3, 5, 5, 7, 7, 9, 10, 11, 11, 13, 13, 15, 16, 17, 17, 19, 19, 21, 22, 23, 23, 25, 26, 27, 28, 29, 29, 31, 31, 33, 34, 35, 36, 37, 37, 39, 40, 41, 41, 43, 43, 45, 46, 47, 47, 49, 50, 51, 52, 53, 53, 55, 56, 57, 58, 59, 59, 61, 61, 63, 64, 65, 66, 67, 67, 69, 70, 71, 71, 73
Offset: 1

Views

Author

Cino Hilliard, Jan 15 2006

Keywords

Comments

This is the complement of sequence A014683.
Möbius transform of A380449(n). - Wesley Ivan Hurt, Jun 21 2025

Crossrefs

Programs

  • Mathematica
    Array[# + Boole[! PrimeQ@ #] &, 72] (* Michael De Vlieger, Nov 05 2020 *)
  • PARI
    a(n) = if (!isprime(n), n+1, n); \\ Michel Marcus, Nov 06 2020

Formula

a(n) = A014684(n) + 1. - Bill McEachen, Nov 01 2020
From Wesley Ivan Hurt, Jun 21 2025: (Start)
a(n) = n + c(n), where c = A005171.
a(n) = Sum_{d|n} A380449(d) * mu(n/d). (End)

Extensions

Offset 1 from Michel Marcus, Nov 06 2020

A135682 a(n)=n if n=1 or if n=prime. Otherwise, n=4 if n is even and n=7 if n is odd.

Original entry on oeis.org

1, 2, 3, 4, 5, 4, 7, 4, 7, 4, 11, 4, 13, 4, 7, 4, 17, 4, 19, 4, 7, 4, 23, 4, 7, 4, 7, 4, 29, 4, 31, 4, 7, 4, 7, 4, 37, 4, 7, 4, 41, 4, 43, 4, 7, 4, 47, 4, 7, 4, 7, 4, 53, 4, 7, 4, 7, 4, 59, 4, 61, 4, 7, 4, 7, 4, 67, 4, 7, 4, 71, 4, 73
Offset: 1

Views

Author

Mohammad K. Azarian, Dec 01 2007

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := If[PrimeQ[n] || n == 1, n, If[EvenQ[n], 4, 7] ]; Table[a[n], {n,1,25}] (* G. C. Greubel, Oct 26 2016 *)

A135684 a(n)=11 if n is a prime number. Otherwise, a(n)=n.

Original entry on oeis.org

1, 11, 11, 4, 11, 6, 11, 8, 9, 10, 11, 12, 11, 14, 15, 16, 11, 18, 11, 20, 21, 22, 11, 24, 25, 26, 27, 28, 11, 30, 11, 32, 33, 34, 35, 36, 11, 38, 39, 40, 11, 42, 11, 44, 45, 46, 11, 48, 49, 50, 51, 52, 11, 54, 55, 56, 57, 58, 11
Offset: 1

Views

Author

Mohammad K. Azarian, Dec 01 2007

Keywords

Crossrefs

Programs

  • Magma
    [IsPrime(n) select 11 else n: n in [1..70]]; // Vincenzo Librandi, Feb 22 2013
  • Mathematica
    Table[If[PrimeQ[n], 11, n], {n, 70}] (* Vincenzo Librandi, Feb 22 2013 *)

A374426 a(n) = n*(n + 1)/2 + pi(n), where pi(n) = A000720(n) is the prime counting function.

Original entry on oeis.org

1, 4, 8, 12, 18, 24, 32, 40, 49, 59, 71, 83, 97, 111, 126, 142, 160, 178, 198, 218, 239, 261, 285, 309, 334, 360, 387, 415, 445, 475, 507, 539, 572, 606, 641, 677, 715, 753, 792, 832, 874, 916, 960, 1004, 1049, 1095, 1143, 1191, 1240, 1290, 1341, 1393, 1447
Offset: 1

Views

Author

James C. McMahon, Jul 08 2024

Keywords

Crossrefs

Partial sums of A014683.

Programs

  • Mathematica
    Table[n(n+1)/2+PrimePi[n],{n,53}]
  • PARI
    a(n) = n*(n+1)/2 + primepi(n); \\ Michel Marcus, Jul 31 2024

Formula

a(n) = A000217(n) + A000720(n).
a(1) = 1; for n > 1: a(n) = a(n-1) + n + A010051(n).

A380457 Sum of divisors of n plus the number of distinct prime divisors of n: a(n) = sigma(n) + omega(n).

Original entry on oeis.org

1, 4, 5, 8, 7, 14, 9, 16, 14, 20, 13, 30, 15, 26, 26, 32, 19, 41, 21, 44, 34, 38, 25, 62, 32, 44, 41, 58, 31, 75, 33, 64, 50, 56, 50, 93, 39, 62, 58, 92, 43, 99, 45, 86, 80, 74, 49, 126, 58, 95, 74, 100, 55, 122, 74, 122, 82, 92, 61, 171, 63, 98, 106, 128, 86, 147, 69, 128, 98, 147, 73, 197, 75, 116, 126, 142, 98, 171, 81, 188, 122, 128, 85, 227, 110, 134, 122
Offset: 1

Views

Author

Wesley Ivan Hurt, Jun 22 2025

Keywords

Comments

Inverse Möbius transform of A014683(n).
For each divisor d of n, add d+1 if d is prime, else add d.

Examples

			a(12) = 1 + (2+1) + (3+1) + 4 + 6 + 12 = 30.
		

Crossrefs

Cf. A000203 (sigma), A001221 (omega), A014683.

Programs

  • Mathematica
    Table[DivisorSigma[1, n] + PrimeNu[n], {n, 100}]

Formula

a(n) = Sum_{d|n} A014683(d).
a(p^k) = (p^(k+1)+p-2)/(p-1) for p prime, k>=1. - Wesley Ivan Hurt, Jul 02 2025

A079778 a(n) = smallest prime number such that a(n) - n is composite.

Original entry on oeis.org

5, 11, 7, 13, 11, 31, 11, 17, 13, 19, 17, 37, 17, 23, 19, 31, 23, 43, 23, 29, 29, 31, 29, 59, 29, 41, 31, 37, 37, 79, 37, 41, 37, 43, 41, 61, 41, 47, 43, 61, 47, 67, 47, 53, 53, 61, 53, 73, 53, 59
Offset: 1

Views

Author

Amarnath Murthy, Feb 03 2003

Keywords

Crossrefs

Cf. A014683.

Extensions

Corrected and extended by Mark Hudson (mrmarkhudson(AT)hotmail.com), Feb 04 2003
Showing 1-10 of 10 results.