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-4 of 4 results.

A034387 Sum of primes <= n.

Original entry on oeis.org

0, 2, 5, 5, 10, 10, 17, 17, 17, 17, 28, 28, 41, 41, 41, 41, 58, 58, 77, 77, 77, 77, 100, 100, 100, 100, 100, 100, 129, 129, 160, 160, 160, 160, 160, 160, 197, 197, 197, 197, 238, 238, 281, 281, 281, 281, 328, 328, 328, 328, 328, 328, 381, 381, 381, 381, 381
Offset: 1

Views

Author

Keywords

Comments

Also sum of all prime factors in n!.
For large n, these numbers can be closely approximated by the number of primes < n^2. For example, the sum of primes < 10^10 = 2220822432581729238. The number of primes < (10^10)^2 or 10^20 = 2220819602560918840. This has a relative error of 0.0000012743... - Cino Hilliard, Jun 08 2008
Equals row sums of triangle A143537. - Gary W. Adamson, Aug 23 2008
Partial sums of A061397. - Reinhard Zumkeller, Mar 21 2014

Crossrefs

This is a lower bound on A287881.

Programs

  • Haskell
    a034387 n = a034387_list !! (n-1)
    a034387_list = scanl1 (+) a061397_list
    -- Reinhard Zumkeller, Mar 21 2014
    
  • Maple
    a:= proc(n) option remember; `if`(n<1, 0,
          a(n-1)+`if`(isprime(n), n, 0))
        end:
    seq(a(n), n=1..60);  # Alois P. Heinz, Jun 29 2022
  • Mathematica
    s=0; Table[s=s+n*Boole[PrimeQ[n]],{n,100}] (* Zak Seidov, Apr 11 2011 *)
    Accumulate[Table[If[PrimeQ[n],n,0],{n,60}]] (* Harvey P. Dale, Jul 25 2016 *)
  • PARI
    a(n)=sum(i=1,primepi(n),prime(i)) \\ Michael B. Porter, Sep 22 2009
    
  • PARI
    a=0;for(k=1,100,print1(a=a+k*isprime(k),", ")) \\ Zak Seidov, Apr 11 2011
    
  • PARI
    a(n) = if(n <= 1, return(0)); my(r=sqrtint(n)); my(V=vector(r, k, n\k)); my(L=n\r-1); V=concat(V, vector(L, k, L-k+1)); my(T=vector(#V, k, V[k]*(V[k]+1)\2)); my(S=Map(matrix(#V,2,x,y,if(y==1,V[x],T[x])))); forprime(p=2, r, my(sp=mapget(S,p-1), p2=p*p); for(k=1, #V, if(V[k] < p2, break); mapput(S, V[k], mapget(S,V[k]) - p*(mapget(S,V[k]\p) - sp)))); mapget(S,n)-1; \\ Daniel Suteu, Jun 29 2022
    
  • Python
    from sympy import isprime
    from itertools import accumulate
    def alist(n): return list(accumulate(k*isprime(k) for k in range(1, n+1)))
    print(alist(57)) # Michael S. Branicky, Sep 18 2021

Formula

From the prime number theorem a(n) has the asymptotic expression: a(n) ~ n^2 / (2 log n). - Dan Fux (dan.fux(AT)OpenGaia.com), Apr 07 2001
a(n) = A158662(n) - 1. a(p) - a(p-1) = p, for p = primes (A000040), a(c) - a(c-1) = 0, for c = composite numbers (A002808). - Jaroslav Krizek, Mar 23 2009
a(n) = n^2/(2 log n) + O(n^2 log log n/log^2 n). - Vladimir Shevelev and Charles R Greathouse IV, May 29 2014
Conjecture: G.f.: Sum_{i>0} Sum_{j>=i} Sum_{k>=j|i-j+k is prime} x^k. - Benedict W. J. Irwin, Mar 31 2017
a(n) = (n+1)*A000720(n) - A046992(n). - Ridouane Oudra, Sep 18 2021
a(n) = A007504(A000720(n)). - Ridouane Oudra, Feb 22 2022
a(n) = Sum_{p<=n, p prime} p. - Wesley Ivan Hurt, Dec 31 2023

A080670 Literal reading of the prime factorization of n.

Original entry on oeis.org

1, 2, 3, 22, 5, 23, 7, 23, 32, 25, 11, 223, 13, 27, 35, 24, 17, 232, 19, 225, 37, 211, 23, 233, 52, 213, 33, 227, 29, 235, 31, 25, 311, 217, 57, 2232, 37, 219, 313, 235, 41, 237, 43, 2211, 325, 223, 47, 243, 72, 252, 317, 2213, 53, 233, 511, 237, 319, 229, 59, 2235
Offset: 1

Views

Author

Jon Perry, Mar 02 2003

Keywords

Comments

Exponents equal to 1 are omitted and therefore this sequence differs from A067599.
Here the first duplicate (ambiguous) term appears already with a(8)=23=a(6), in A067599 this happens only much later. - M. F. Hasler, Oct 18 2014
The number n = 13532385396179 = 13·53^2·3853·96179 = a(n) is (maybe the first?) nontrivial fixed point of this sequence, making it the first known index of a -1 in A195264. - M. F. Hasler, Jun 06 2017

Examples

			8=2^3, which reads 23, hence a(8)=23; 12=2^2*3, which reads 223, hence a(12)=223.
		

Crossrefs

See A195330, A195331 for those n for which a(n) is a contraction.
See also home primes, A037271.
See A195264 for what happens when k -> a(k) is repeatedly applied to n.
Partial sums: A287881, A287882.

Programs

  • Haskell
    import Data.Function (on)
    a080670 1 = 1
    a080670 n = read $ foldl1 (++) $
    zipWith (c `on` show) (a027748_row n) (a124010_row n) :: Integer
    where c ps es = if es == "1" then ps else ps ++ es
    -- Reinhard Zumkeller, Oct 27 2013
    
  • Maple
    ifsSorted := proc(n)
            local fs,L,p ;
            fs := sort(convert(numtheory[factorset](n),list)) ;
            L := [] ;
            for p in fs do
                    L := [op(L),[p,padic[ordp](n,p)]] ;
            end do;
            L ;
    end proc:
    A080670 := proc(n)
            local a,p ;
            if n = 1 then
                    return 1;
            end if;
            a := 0 ;
            for p in ifsSorted(n) do
                    a := digcat2(a,op(1,p)) ;
                    if op(2,p) > 1 then
                            a := digcat2(a,op(2,p)) ;
                    end if;
            end do:
            a ;
    end proc: # R. J. Mathar, Oct 02 2011
    # second Maple program:
    a:= proc(n) option remember; `if`(n=1, 1, (l->
          parse(cat(seq(`if`(l[i, 2]=1, l[i, 1], [l[i, 1],
          l[i, 2]][]), i=1..nops(l)))))(sort(ifactors(n)[2])))
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Mar 17 2020
  • Mathematica
    f[n_] := FromDigits[ Flatten@ IntegerDigits[ Flatten[ FactorInteger@ n /. {1 -> {}}]]]; f[1] = 1; Array[ f, 60] (* Robert G. Wilson v, Mar 02 2003 and modified Jul 22 2014 *)
  • PARI
    A080670(n)=if(n>1, my(f=factor(n),s=""); for(i=1,#f~,s=Str(s,f[i,1],if(f[i,2]>1, f[i,2],""))); eval(s),1) \\ Charles R Greathouse IV, Oct 27 2013; case n=1 added by M. F. Hasler, Oct 18 2014
    
  • PARI
    A080670(n)=if(n>1,eval(concat(apply(f->Str(f[1],if(f[2]>1,f[2],"")),Vec(factor(n)~)))),1) \\ M. F. Hasler, Oct 18 2014
    
  • Python
    import sympy
    [int(''.join([str(y) for x in sorted(sympy.ntheory.factorint(n).items()) for y in x if y != 1])) for n in range(2,100)] # compute a(n) for n > 1
    # Chai Wah Wu, Jul 15 2014

Extensions

Edited and extended by Robert G. Wilson v, Mar 02 2003

A287882 a(n) = Sum_{ i <= n, i squarefree} A080670(i).

Original entry on oeis.org

1, 3, 6, 6, 11, 34, 41, 41, 41, 66, 77, 77, 90, 117, 152, 152, 169, 169, 188, 188, 225, 436, 459, 459, 459, 672, 672, 672, 701, 936, 967, 967, 1278, 1495, 1552, 1552, 1589, 1808, 2121, 2121, 2162, 2399, 2442, 2442, 2442, 2665, 2712, 2712, 2712, 2712, 3029, 3029, 3082, 3082, 3593, 3593, 3912
Offset: 1

Views

Author

N. J. A. Sloane, Jun 19 2017

Keywords

Comments

A lower bound on A287881.

Crossrefs

Programs

  • Mathematica
    A080670 = Cases[Import["https://oeis.org/A080670/b080670.txt", "Table"], {, }][[All, 2]];
    Accumulate[Table[If[SquareFreeQ[n], A080670[[n]], 0], {n, 57}] ] (* Robert Price, Mar 16 2020 *)

A291803 Partial sums of A230625.

Original entry on oeis.org

1, 3, 6, 16, 21, 32, 39, 50, 64, 85, 96, 139, 152, 175, 204, 224, 241, 287, 306, 391, 422, 465, 488, 535, 557, 602, 617, 704, 733, 826, 857, 878, 937, 1018, 1065, 1239, 1276, 1359, 1420, 1513, 1554, 1649, 1692, 1863, 1980, 2067, 2114, 2197, 2227, 2313, 2426
Offset: 1

Views

Author

N. J. A. Sloane, Sep 06 2017

Keywords

Comments

Although A230625 is a very irregular function, here the graph is much smoother, and it appears that a(n) approx= 1.2*n^2. It would be nice to have a more precise estimate.

Crossrefs

Programs

Showing 1-4 of 4 results.