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.

Previous Showing 21-30 of 40 results. Next

A143536 Triangle read by rows, T(n,k) = 1 if n is prime, 0 otherwise.

Original entry on oeis.org

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

Views

Author

Gary W. Adamson, Aug 23 2008

Keywords

Comments

Row sums = A061397: (0, 2, 3, 0, 5, 0, 7,...).

Examples

			First few rows of the triangle =
0;
1, 1;
1, 1, 1;
0, 0, 0, 0;
1, 1, 1, 1, 1;
0, 0, 0, 0, 0, 0;
1, 1, 1, 1, 1, 1, 1;
...
		

Crossrefs

Programs

  • Haskell
    a143536 n k = a143536_tabl !! (n-1) !! (k-1)
    a143536_row n = a143536_tabl !! (n-1)
    a143536_tabl = zipWith take [1..] $ map repeat a010051_list
    -- Reinhard Zumkeller, Mar 21 2014

Formula

Triangle read by rows, T(n,k) = 1 if n is prime, 0 otherwise. Mobius transform (A054525) of triangle A143535.

A143545 a(n) = n unless n is a prime, in which case a(n) = 2n.

Original entry on oeis.org

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

Views

Author

Gary W. Adamson, Aug 23 2008

Keywords

Examples

			a(3) = 6 = 2*3 since 3 is prime.
a(4) = 4 since 4 is a nonprime.
		

Crossrefs

See A282028 for another version.

Formula

a(n) = n + A061397(n), where A061397 = (0, 2, 3, 0, 5, 0, 7,...).
Equals row sums of triangle A143544.
a(n)=A066560(n), n>1. [From R. J. Mathar, Sep 05 2008]

Extensions

Extended beyond a(14) by R. J. Mathar, Sep 05 2008

A347104 Dirichlet g.f.: primezeta(s-1) * zeta(s-1) / zeta(s).

Original entry on oeis.org

0, 2, 3, 2, 5, 7, 7, 4, 6, 13, 11, 10, 13, 19, 22, 8, 17, 18, 19, 18, 32, 31, 23, 20, 20, 37, 18, 26, 29, 38, 31, 16, 52, 49, 58, 24, 37, 55, 62, 36, 41, 56, 43, 42, 54, 67, 47, 40, 42, 60, 82, 50, 53, 54, 94, 52, 92, 85, 59, 60, 61, 91, 78, 32, 112, 92, 67, 66, 112, 106, 71, 48, 73, 109, 100
Offset: 1

Views

Author

Ilya Gutkovskiy, Aug 18 2021

Keywords

Comments

a(n) is the sum of the prime terms in row n of A050873.
Moebius transform of A328260.

Crossrefs

Programs

  • Mathematica
    Table[DivisorSum[n, MoebiusMu[n/#] # PrimeNu[#] &], {n, 1, 75}]
    Table[DivisorSum[n, # EulerPhi[n/#] &, PrimeQ[#] &], {n, 1, 75}]
    Table[Sum[Boole[PrimeQ[GCD[n, k]]] GCD[n, k], {k, 1, n}], {n, 1, 75}]
  • PARI
    a(n) = sumdiv(n, d, moebius(n/d)*d*omega(d)); \\ Michel Marcus, Aug 18 2021

Formula

a(n) = Sum_{d|n} mu(n/d) * d * omega(d).
a(n) = Sum_{p|n, p prime} p * phi(n/p).
a(n) = Sum_{k=1..n} A010051(gcd(n,k)) * gcd(n,k).

A143544 Triangle read by rows, T(n,k) = 2 if n is prime, 1 otherwise; 1<=k<=n.

Original entry on oeis.org

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

Views

Author

Gary W. Adamson, Aug 23 2008

Keywords

Comments

Row sums = A143545: (1, 4, 6, 4, 10, 6, 14,...) = componentwise addition of (1, 2, 3, 4, 5,...) and A061397: (0, 2, 3, 0, 5, 0, 7,...).

Examples

			First few rows of the triangle =
1;
2, 2;
2, 2, 2;
1, 1, 1, 1;
2, 2, 2, 2, 2;
1, 1, 1, 1, 1, 1;
2, 2, 2, 2, 2, 2, 2;
...
		

Crossrefs

Programs

  • Mathematica
    Table[1 + Boole[PrimeQ[n]], {n, 11}, {k, n}] // Flatten (* Michael De Vlieger, Oct 31 2021 *)

Formula

Triangle read by rows, T(n,k) = 2 if n is prime, 1 otherwise; 1<=k<=n.
T(n, k) = A143536(n, k) + 1. - Georg Fischer, Oct 31 2021

A193315 Write 2n=j+q (j,q positive noncomposite numbers); j*q maximal; then a(n)=j*q.

Original entry on oeis.org

1, 4, 9, 15, 25, 35, 49, 55, 77, 91, 121, 143, 169, 187, 221, 247, 289, 323, 361, 391, 437, 403, 529, 551, 589, 667, 713, 703, 841, 899, 961, 943, 1073, 1147, 1189, 1271, 1369, 1363, 1517, 1591, 1681, 1763, 1849, 1927, 2021, 1891, 2209, 2279, 2257, 2491, 2537, 2623, 2809, 2867, 2881
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Aug 26 2011

Keywords

Comments

a(n) = A102084(n) for n > 0. [Reinhard Zumkeller, Aug 28 2011]

Examples

			At n=6, 2n=12; 12 = 1 + 11 = 7 + 5; 7*5 = maximal => j*q = 7*5 = 35.
		

Crossrefs

Programs

  • Haskell
    a193315 1 = 1
    a193315 n = maximum $ zipWith (*) prims $ map (a061397 . (2*n -)) prims
       where prims = takeWhile (<= n) a008578_list
    -- Reinhard Zumkeller, Aug 28 2011
  • Maple
    isA008578 := proc(n) if n = 1 then true ; elif isprime(n) then true; else false; end if; end proc:
    A193315 := proc(n) local mx,j,q ; mx := 0 ; for j from 1 to 2*n-1 do if isA008578(j) then q := 2*n-j ; if isA008578(q) then mx := max(mx,j*q) ; end if ; end if; end do: mx ; end proc:
    seq(A193315(n),n=1..60) ; # R. J. Mathar, Aug 28 2011
  • Sage
    def is_A008578(n): return n == 1 or is_prime(n)
    def A193315(n): return max((j*(2*n-j)) for j in [1]+prime_range(n+1) if is_A008578(2*n-j))
    [A193315(i) for i in range(1,15)]
    # D. S. McNeil, Aug 27 2011
    

A349712 a(n) = Sum_{d|n} sopf(d) * sopf(n/d).

Original entry on oeis.org

0, 0, 0, 4, 0, 12, 0, 8, 9, 20, 0, 32, 0, 28, 30, 12, 0, 42, 0, 48, 42, 44, 0, 52, 25, 52, 18, 64, 0, 124, 0, 16, 66, 68, 70, 87, 0, 76, 78, 76, 0, 164, 0, 96, 78, 92, 0, 72, 49, 90, 102, 112, 0, 72, 110, 100, 114, 116, 0, 234, 0, 124, 102, 20, 130, 244, 0, 144, 138, 236, 0, 132, 0, 148, 110
Offset: 1

Views

Author

Ilya Gutkovskiy, Nov 26 2021

Keywords

Comments

Dirichlet convolution of A008472 with itself.

Crossrefs

Programs

  • Mathematica
    sopf[n_] := DivisorSum[n, # &, PrimeQ[#] &]; a[n_] := Sum[sopf[d] sopf[n/d], {d, Divisors[n]}]; Table[a[n], {n, 1, 75}]
  • PARI
    sopf(n) = vecsum(factor(n)[, 1]); \\ A008472
    a(n) = sumdiv(n, d, sopf(d)*sopf(n/d)); \\ Michel Marcus, Nov 26 2021
    
  • Python
    from sympy import divisors, factorint
    def sopf(n): return sum(factorint(n))
    def a(n): return sum(sopf(d)*sopf(n//d) for d in divisors(n))
    print([a(n) for n in range(1, 76)]) # Michael S. Branicky, Nov 26 2021

Formula

Dirichlet g.f.: ( zeta(s) * primezeta(s-1) )^2.
a(n) = Sum_{d|n} A061397(d) * A319131(n/d).
a(p) = 0 for p prime. - Michael S. Branicky, Nov 26 2021
a(p^k) = (k-1)*p^2 for p prime and k > 0. - Chai Wah Wu, Nov 28 2021

A002123 a(1) = 0, a(2) = 0; for n > 2, a(n) - a(n-3) - a(n-5) - ... - a(n-p) = n if n is prime, otherwise = 0, where p = largest prime < n.

Original entry on oeis.org

0, 0, 3, 0, 5, -3, 7, -8, 3, -15, 22, -15, 39, -35, 38, -72, 85, -111, 152, -175, 241, -308, 414, -551, 655, -897, 1164, -1463, 2001, -2538, 3286, -4296, 5503, -7259, 9357, -12147, 15910, -20406, 26640, -34703, 44854, -58481, 75809, -98340
Offset: 1

Views

Author

Keywords

Comments

Arises in studying the Goldbach conjecture.

References

  • P. A. MacMahon, Properties of prime numbers deduced from the calculus of symmetric functions, Proc. London Math. Soc., 23 (1923), 290-316. [Coll. Papers, Vol. II, pp. 354-382] [The sequence f_n]
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    import Data.List (genericIndex)
    a002123 n = genericIndex a002123_list (n - 1)
    a002123_list = 0 : 0 : f 3 where
       f x = y : f (x + 1) where
         y = a061397 x -
             sum (map (a002123 . (x -)) $ takeWhile (< x) a065091_list)
    -- Reinhard Zumkeller, Mar 21 2014

Extensions

Extended with signs by T. D. Noe, Dec 05 2006

A063084 a(n) = pi(n-1)*n - pi(n)*(n-1), where pi() = A000720().

Original entry on oeis.org

0, -1, -1, 2, -2, 3, -3, 4, 4, 4, -6, 5, -7, 6, 6, 6, -10, 7, -11, 8, 8, 8, -14, 9, 9, 9, 9, 9, -19, 10, -20, 11, 11, 11, 11, 11, -25, 12, 12, 12, -28, 13, -29, 14, 14, 14, -32, 15, 15, 15, 15, 15, -37, 16, 16, 16, 16, 16, -42, 17, -43, 18, 18, 18, 18, 18, -48, 19, 19, 19, -51, 20, -52, 21, 21, 21, 21, 21, -57, 22, 22, 22, -60, 23, 23
Offset: 1

Views

Author

Labos Elemer, Aug 06 2001

Keywords

Comments

To define as positive sequence let C(n)= A062298; f(a) = pi(a) if a is nonprime, f(a)= C(a) if a is prime. - Daniel Tisdale, Nov 07 2008

Examples

			The function is positive for composite and negative for prime numbers. It is zero at n=1.
		

References

  • G. A. Kudrevatow, (1970): Exercises in Number Theory. Problem 488; page 56; Prosveshenie, Moscow [in Russian].

Crossrefs

Programs

  • PARI
    a(n)={if(n>1, primepi(n-1)*n - primepi(n)*(n-1), 0)} \\ Harry J. Smith, Aug 17 2009

A259175 a(n) = 1 if n prime, otherwise prime(n).

Original entry on oeis.org

2, 1, 1, 7, 1, 13, 1, 19, 23, 29, 1, 37, 1, 43, 47, 53, 1, 61, 1, 71, 73, 79, 1, 89, 97, 101, 103, 107, 1, 113, 1, 131, 137, 139, 149, 151, 1, 163, 167, 173, 1, 181, 1, 193, 197, 199, 1, 223, 227, 229, 233, 239, 1, 251, 257, 263, 269, 271, 1, 281, 1, 293, 307, 311
Offset: 1

Views

Author

Vincenzo Librandi, Jun 20 2015

Keywords

Comments

The subsequence of prime terms is A007821. - Michel Marcus, Jun 20 2015

Examples

			a(7) = 1 because 7 is prime.
a(8) = 19 because 8 is not prime and prime(8) = 19.
		

Crossrefs

Programs

  • Magma
    [IsPrime(n) select 1 else NthPrime(n): n in [1..100]];
  • Mathematica
    Table[If[PrimeQ[n], 1, Prime[n]], {n, 100}]

A272476 a(n) = n if n is prime, a(n) = 2*n+3 otherwise.

Original entry on oeis.org

3, 5, 2, 3, 11, 5, 15, 7, 19, 21, 23, 11, 27, 13, 31, 33, 35, 17, 39, 19, 43, 45, 47, 23, 51, 53, 55, 57, 59, 29, 63, 31, 67, 69, 71, 73, 75, 37, 79, 81, 83, 41, 87, 43, 91, 93, 95, 47, 99, 101, 103, 105, 107, 53, 111, 113, 115, 117, 119, 59, 123, 61, 127
Offset: 0

Views

Author

Vincenzo Librandi, May 02 2016

Keywords

Comments

Prime numbers repeated: 3, 5, 11, 19, 23, 31, 43, 47, 53, 59, 67, 71, ..., that is A065091 without A089531.

Crossrefs

Programs

  • Magma
    [IsPrime(n) select n else 2*n+3: n in [0..80]];
  • Mathematica
    Table[If[PrimeQ[n], n, 2 n + 3], {n, 0, 150}]
Previous Showing 21-30 of 40 results. Next