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.

A024934 Sum of remainders n mod p, over all primes p < n.

Original entry on oeis.org

0, 0, 0, 1, 1, 3, 1, 4, 6, 7, 4, 8, 8, 13, 10, 8, 12, 18, 20, 27, 28, 26, 21, 29, 33, 37, 31, 37, 37, 46, 46, 56, 65, 62, 54, 53, 59, 70, 61, 57, 62, 74, 75, 88, 89, 95, 84, 98, 108, 116, 124, 119, 119, 134, 145, 145, 152, 146, 131, 147, 154, 171, 156, 164, 180, 180, 182, 200, 200, 193, 198, 217
Offset: 0

Views

Author

Keywords

Examples

			a(5) = 3. The remainder when 5 is divided by primes 2, 3 respectively is 1, 2, and their sum = 3.
10 = 2*5+0 = 3*3+1 = 5*2+0 = 7*1+3: a(10) = 0+1+0+3 = 4.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Sum[Mod[n, Prime[i]], {i, PrimePi@ n}]; Array[a, 72, 0] (* Giovanni Resta, Jun 24 2016 *)
    Table[Total[Mod[n,Prime[Range[PrimePi[n]]]]],{n,0,80}] (* Harvey P. Dale, Jul 02 2025 *)
  • PARI
    a(n)=my(r=0);forprime(p=2,n,r+=n%p); r; \\ Joerg Arndt, Nov 05 2016

Formula

a(n) = n*A000720(n) - A024924(n). - Max Alekseyev, Feb 10 2012
a(n) = a(n-1) + A000720(n-1) - A105221(n). - Max Alekseyev, Nov 28 2017

Extensions

Edited by Max Alekseyev, Jan 30 2012
a(0)=0 prepended by Max Alekseyev, Dec 10 2013

A003508 a(1) = 1; for n>1, a(n) = a(n-1) + 1 + sum of distinct prime factors of a(n-1) that are < a(n-1).

Original entry on oeis.org

1, 2, 3, 4, 7, 8, 11, 12, 18, 24, 30, 41, 42, 55, 72, 78, 97, 98, 108, 114, 139, 140, 155, 192, 198, 215, 264, 281, 282, 335, 408, 431, 432, 438, 517, 576, 582, 685, 828, 857, 858, 888, 931, 958, 1440, 1451, 1452, 1469, 1596, 1628, 1679, 1776, 1819, 1944
Offset: 1

Views

Author

Keywords

Comments

R. K. Guy reports, Apr 14 2005: In Math. Mag. 48 (1975) 301 one finds "C. W. Trigg, C. C. Oursler and R. Cormier & J. L. Selfridge have sent calculations on Problem 886 [Nov 1973] for which we had received only partial results [Jan 1975]. Cormier and Selfridge sent the following results: There appear to be five sequences beginning with integers less than 1000 which do not merge. These sequences were carried out to 10^8 or more." The five sequences are A003508, A105210-A105213.
This suggests that there may be infinitely many different (non-merging) sequences obtained by choosing different starting values.
All terms of these five sequences are distinct up to least 10^30. - T. D. Noe, Oct 19 2007

Examples

			a(6)=8, so a(7) = 8 + 1 + 2 = 11.
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a003508 n = a003508_list !! (n-1)
    a003508_list = 1 : map
          (\x -> x + 1 + sum (takeWhile (< x) $ a027748_row x)) a003508_list
    -- Reinhard Zumkeller, Jan 15 2015
  • Mathematica
    a[1] = 1; a[n_] := a[n] = a[n - 1] + 1 + Plus @@ Select[ Flatten[ Table[ #[[1]], {1}] & /@ FactorInteger[ a[n - 1]]], # < a[n - 1] &]; Table[ a[n], {n, 54}] (* Robert G. Wilson v, Apr 13 2005 *)
    nxt[n_]:=n+1+Total[Select[Transpose[FactorInteger[n]][[1]],#Harvey P. Dale, Jul 19 2015 *)

Extensions

More terms from Henry Bottomley, May 09 2000

A136021 Sum of the proper prime divisors of all numbers up to 10^n.

Original entry on oeis.org

0, 19, 1047, 64373, 4481640, 340900331, 27436000061, 2292176360707, 196818634871899, 17246903703574357, 1534951275195670059, 138293592048140425181, 12583738258227621100170, 1154435823206834353336284, 106638384745041347295504523
Offset: 0

Views

Author

Enoch Haga, Dec 10 2007

Keywords

Comments

The sum of the distinct prime factors less than k for all 1 <= k <= 10^n, as tabulated for the individual k in A105221.

Examples

			a(1)=19 because 10^1=10 and the factors to be summed are 2 for 4, added to 2 and 3 for 6, added to 2 for 8, added to 3 for 9, added to 2 and 5 for 10.
		

Crossrefs

Programs

  • Maple
    A105221 := proc(n) local a,pfs,i ; a :=0 ; pfs := ifactors(n)[2] ; for i in pfs do if op(1,i) <> 1 and op(1,i) <> n then a := a+op(1,i) ; fi ; od: RETURN(a) ; end: A136021 := proc(n) add(A105221(i),i=2..10^n) ; end: for n from 1 do print(n,A136021(n)) ; od: # R. J. Mathar, Dec 12 2007
  • Mathematica
    f[n_] := Plus @@ (First@# & /@ FactorInteger@ n); k = 2; s = 0; lst = {}; Do[While[k < 10^n + 1, If[ ! PrimeQ@k, s = s + f@k]; k++ ]; AppendTo[ lst, s]; Print[{n, s}], {n, 8}] (* Robert G. Wilson v, Aug 06 2010 *)
  • UBASIC
    10 'distinct prime factors of composites <=10^n 20 S=0:N=N+1:Z=N\2 30 'print N; 40 for F=1 to Z:Q=N/F: if Q<>int(Q) then 60 50 S=S+F: if F=prmdiv(F) and F>1 then C=C+1:G=G+F 60 next F 70 'print C,G 80 if N=10^1 or N=10^2 or N=10^3 or N=10^4 or N=10^5 or N=10^6 or N=10^7 then print G:stop 90 C=0 100 goto 20

Formula

a(n) = Sum_{k=1..10^n} A105221(k). - R. J. Mathar, Dec 12 2007
a(n) = Sum_{prime p<10^n} p*floor((10^n-p)/p) = A006880(n)*10^n - A024934(10^n) - A046731(n). - Max Alekseyev, Jan 30 2012

Extensions

One more term from R. J. Mathar, Dec 12 2007
Edited by R. J. Mathar, Apr 17 2009
a(7) & a(8) from Robert G. Wilson v, Aug 06 2010
a(9)-a(11) from Max Alekseyev, Jan 30 2012
a(12)-a(14) from Hiroaki Yamanouchi, Jun 29 2014

A048055 Numbers k such that (sum of the nonprime proper divisors of k) - (sum of prime divisors of k) = k.

Original entry on oeis.org

532, 945, 2624, 5704, 6536, 229648, 497696, 652970, 685088, 997408, 1481504, 11177984, 32869504, 52813084, 132612224, 224841856, 2140668416, 2404135424, 2550700288, 6469054976, 9367192064, 19266023936, 23414463358, 31381324288, 45812547584, 55620289024
Offset: 1

Views

Author

Keywords

Comments

From Peter Luschny, Dec 14 2009: (Start)
A term of this sequence is a Zumkeller number (A083207) since the set of its divisors can be partitioned into two disjoint parts so that the sums of the two parts are equal.
1 + sigma*(k) = sigma'(k) + k
sigma*(k) := Sum_{1 < d < k, d|k, d not prime}, (A060278),
sigma'(k) := Sum_{1 < d < k, d|k, d prime}, (A105221). (End)

Examples

			532 = 1 - 2 + 4 - 7 + 14 - 19 + 28 + 38 + 76 + 133 + 266.
		

Crossrefs

Programs

  • Haskell
    import Data.List (partition)
    a048055 n = a048055_list !! (n-1)
    a048055_list = [x | x <- a002808_list,
                   let (us,vs) = partition ((== 1) . a010051) $ a027751_row x,
                   sum us + x == sum vs]
    -- Reinhard Zumkeller, Apr 05 2013
    
  • Maple
    with(numtheory): A048055 := proc(n) local k;
    if sigma(n)=2*(n+add(k,k=select(isprime,divisors(n))))
    then n else NULL fi end: seq(A048055(i),i=1..7000);
    # Peter Luschny, Dec 14 2009
  • Mathematica
    zummableQ[n_] := DivisorSigma[1, n] == 2*(n + Total[Select[Divisors[n], PrimeQ]]); n = 2; A048055 = {}; While[n < 10^6, If[zummableQ[n], Print[n]; AppendTo[A048055, n]]; n++]; A048055 (* Jean-François Alcover, Dec 07 2011, after Peter Luschny *)
  • Python
    from sympy import divisors, primefactors
    A048055 = []
    for n in range(1,10**4):
        s = sum(divisors(n))
        if not s % 2 and 2*n <= s and (s-2*n)/2 == sum(primefactors(n)):
            A048055.append(n) # Chai Wah Wu, Aug 20 2014

Extensions

a(15)-a(19) from Donovan Johnson, Dec 07 2008
a(20)-a(24) from Donovan Johnson, Jul 06 2010
a(25)-a(26) from Donovan Johnson, Feb 09 2012

A136025 Sum of distinct proper prime divisors of odd integers below 10^n.

Original entry on oeis.org

3, 373, 24307, 1691682, 127867801, 10233538789, 850896280551, 72812857079241, 6363727756215813, 565232434009370012, 50843507342073211151, 4620323131256374760046, 423405369424475640435621, 39074878176445767411791424
Offset: 1

Views

Author

Enoch Haga, Dec 12 2007

Keywords

Comments

Through 10^5 about 37.5% of total sums for all integers N comprise sums of odd N and the remaining 62.5% of even N.

Examples

			a(0)=3 because the only odd N <=10^1-1 having a prime factor is 9 and its factor is 3 and sum is 3.
		

Crossrefs

Programs

  • Maple
    A105221 := proc(n) local a,ifs,p; ifs := ifactors(n)[2] ; a := 0 ; for p in ifs do if op(1,p) <> 1 and op(1,p) <> n then a := a+op(1,p) ; fi ; od: RETURN(a) ; end: A136025 := proc(n) local a,k ; a := 0 ; for k from 5 to 10^n-1 by 2 do a := a+A105221(k) ; od: RETURN(a) ; end: for n from 1 do print(A136025(n)); od: # R. J. Mathar, Jan 29 2008

Formula

a(n) = sum_{k=1,2,...,A093143(n)} A105221(2k-1). - R. J. Mathar, Jan 29 2008
a(n) = sum_{prime p, 3<=p<10^n} p*floor((10^n-p)/(2p)). - Max Alekseyev, Jan 30 2012

Extensions

a(6) from R. J. Mathar, Jan 29 2008
a(7)-a(11) from Max Alekseyev, Jan 30 2012
a(12)-a(14) from Hiroaki Yamanouchi, Jul 06 2014

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)

A137324 a(n) = Sum_{prime p < n} gcd(n,p).

Original entry on oeis.org

1, 3, 2, 6, 3, 5, 6, 9, 4, 8, 5, 13, 12, 7, 6, 10, 7, 13, 16, 19, 8, 12, 13, 22, 11, 16, 9, 17, 10, 12, 23, 28, 21, 14, 11, 31, 26, 17, 12, 22, 13, 25, 20, 37, 14, 18, 21, 20, 33, 28, 15, 19, 30, 23, 36, 45, 16, 24, 17, 49, 26, 19, 34, 31, 18, 36, 43, 30, 19, 23, 20, 58, 27, 40, 37
Offset: 3

Views

Author

Max Sills, Apr 06 2008

Keywords

Examples

			a(10) = 9 because gcd(10,2) = 2, gcd(10,3) = 1, gcd(10,5) = 5, gcd(10,7) = 1; 2 + 1 + 5 + 1 = 9.
The underlying irregular table of gcd(n,2), gcd(n,3), gcd(n,5), gcd(n,7), etc., for which a(n) provides row sums, is obtained by deleting columns from A050873(n,k) and looks as follows for n=3,4,5,...:
  1
  2 1
  1 1
  2 3 1
  1 1 1
  2 1 1 1
  1 3 1 1
  2 1 5 1
  1 1 1 1
  2 3 1 1 1
  1 1 1 1 1
  2 1 1 7 1 1
  1 3 5 1 1 1
  2 1 1 1 1 1
  1 1 1 1 1 1
  2 3 1 1 1 1 1
  1 1 1 1 1 1 1
  2 1 5 1 1 1 1 1
		

Crossrefs

Programs

  • Magma
    [&+[Gcd(n,p):p in PrimesInInterval(1,n-1)]:n in [3..77]]; // Marius A. Burtea, Aug 07 2019
    
  • Maple
    A137324 := proc(n) local a,i; a :=0 ; for i from 1 to numtheory[pi](n-1) do a := a+gcd(n,ithprime(i)) ; od: a; end: seq(A137324(n),n=3..80) ; # R. J. Mathar, Apr 09 2008
  • Mathematica
    Table[Plus @@ GCD[n, Select[Range[n - 1], PrimeQ[ # ] &]], {n, 3, 70}] (* Stefan Steinerberger, Apr 09 2008 *)
  • PARI
    a(n) = sum(k=1, n-1, gcd(n,k)*isprime(k)); \\ Michel Marcus, Nov 07 2014
    
  • Python
    from math import gcd
    from sympy import primerange
    def a(n): return sum(gcd(n, p) for p in primerange(1, n))
    print([a(n) for n in range(3, 78)]) # Michael S. Branicky, Nov 21 2021

Formula

a(p) = A000720(p) - 1 for prime p. - R. J. Mathar, Apr 09 2008
a(n) = A048865(n) + A105221(n). - Wesley Ivan Hurt, Nov 21 2021

Extensions

Corrected and extended by R. J. Mathar and Stefan Steinerberger, Apr 09 2008

A140599 Grand total of prime factors in composite runs between two primes: first composite.

Original entry on oeis.org

4, 6, 12, 14, 18, 24, 54, 62, 68, 72, 80, 90, 108, 110, 158, 192, 234, 258, 264, 318, 338, 350, 354, 380, 420, 432, 458, 462, 570, 588, 602, 632, 662, 858, 978, 992, 1050, 1088, 1094, 1152, 1172, 1290, 1302, 1304, 1400, 1428, 1434, 1482, 1532, 1722, 1824, 1862
Offset: 1

Views

Author

Enoch Haga, May 18 2008

Keywords

Examples

			In the composite run between primes 23 and 29 there are five composites. The sum of prime factors in all 5 composites is 37 (3+2+5+13+2+3+7+2). The first composite in this run is 24, a(6) and the last is 28.
		

Crossrefs

Cf. A140600.

Formula

Compute composite runs between two primes. If the grand total of prime factors in each run is also prime, add the firat composite to the sequence.
{A008864(j): sum_{k=A008864(j)..A006093(j+1)} A105221(k) in A000040}. - R. J. Mathar, May 19 2008

A343394 Sum of indices of n's distinct prime factors below n.

Original entry on oeis.org

0, 0, 0, 1, 0, 3, 0, 1, 2, 4, 0, 3, 0, 5, 5, 1, 0, 3, 0, 4, 6, 6, 0, 3, 3, 7, 2, 5, 0, 6, 0, 1, 7, 8, 7, 3, 0, 9, 8, 4, 0, 7, 0, 6, 5, 10, 0, 3, 4, 4, 9, 7, 0, 3, 8, 5, 10, 11, 0, 6, 0, 12, 6, 1, 9, 8, 0, 8, 11, 8, 0, 3, 0, 13, 5, 9, 9, 9, 0, 4, 2, 14, 0, 7, 10, 15, 12, 6, 0, 6
Offset: 1

Views

Author

Ilya Gutkovskiy, Apr 13 2021

Keywords

Examples

			a(7) = a(prime(4)) = 0.
a(21) = a(3 * 7) = a(prime(2) * prime(4)) = 2 + 4 = 6.
		

Crossrefs

Programs

  • Mathematica
    nmax = 90; CoefficientList[Series[Sum[k x^(2 Prime[k])/(1 - x^Prime[k]), {k, 1, nmax}], {x, 0, nmax}], x] // Rest
    a[n_] := If[PrimeQ[n], 0, Plus @@ (PrimePi[#[[1]]] & /@ FactorInteger[n])]; Table[a[n], {n, 90}]

Formula

G.f.: Sum_{k>=1} k * x^(2*prime(k)) / (1 - x^prime(k)).
a(n) = 0 if n is prime, A066328(n) otherwise.

A352167 a(n) is the sum of the prime factors of n (with multiplicity) that are less than n.

Original entry on oeis.org

0, 0, 0, 4, 0, 5, 0, 6, 6, 7, 0, 7, 0, 9, 8, 8, 0, 8, 0, 9, 10, 13, 0, 9, 10, 15, 9, 11, 0, 10, 0, 10, 14, 19, 12, 10, 0, 21, 16, 11, 0, 12, 0, 15, 11, 25, 0, 11, 14, 12, 20, 17, 0, 11, 16, 13, 22, 31, 0, 12, 0, 33, 13, 12, 18, 16, 0, 21, 26, 14, 0, 12, 0, 39, 13, 23, 18, 18, 0, 13
Offset: 1

Views

Author

Ilya Gutkovskiy, Mar 06 2022

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := If[n == 1 || PrimeQ[n], 0, Plus @@ Times @@@ FactorInteger@n]; Table[a[n], {n, 80}]
  • PARI
    a(n) = if (isprime(n), 0, my(f=factor(n)); sum(k=1, #f~, f[k,1]*f[k,2])); \\ Michel Marcus, Mar 07 2022

Formula

a(n) = 0 if n is prime, A001414(n) otherwise.
a(n) = A001414(n) - A061397(n).
Showing 1-10 of 10 results.