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

A080355 a(1)=1; thereafter, a(n+1) = a(n) + 2^(prime(n)-1).

Original entry on oeis.org

1, 3, 7, 23, 87, 1111, 5207, 70743, 332887, 4527191, 272962647, 1346704471, 70066181207, 1169577808983, 5567624320087, 75936368497751, 4579535995868247, 292809912147579991, 1445731416754426967, 75232707711592633431, 1255824328429003936855, 5978190811298649150551
Offset: 1

Views

Author

N. J. A. Sloane, based on information supplied by Artur Jasinski, Mar 21 2003

Keywords

Comments

Original name: a(1)=1; for n>1, a(n) = a(n-1) + 2^(j-1), where j = prime(n-1) is position of n-th 1 in A080339.
Or, take an initial segment of A080339, stopping at the n-th 1, reverse and interpret as a binary number. E.g., to get the 4th term: 11101 -> 10111 = 23, so a(4) = 23.
Indices of noncomposite terms in the sequence are 1, 2, 3, 4, 9, 310, 418, .... Next term (i.e., index of a prime), if it exists, is > 2000. See also post to SeqFan list by Tomasz Ordowski. - M. F. Hasler, Oct 30 2018

Crossrefs

Cf. A076793.

Programs

  • Magma
    [n le 1 select 1 else Self(n-1) + 2^(NthPrime(n-1)-1): n in [1..25]]; // Vincenzo Librandi, Oct 31 2018
  • Maple
    a:=n->1+add(2^(ithprime(k)-1),k=1..n-1): seq(a(n),n=1..25); # Muniru A Asiru, Oct 31 2018
  • Mathematica
    RecurrenceTable[{a[1]==1, a[n] == 2^(Prime[n-1] - 1) + a[n-1]}, a, {n, 25}] (* Vincenzo Librandi, Oct 31 2018 *)
    nxt[{n_,a_}]:={n+1,a+2^(Prime[n]-1)}; NestList[nxt,{1,1},30][[All,2]] (* Harvey P. Dale, Aug 07 2019 *)
  • PARI
    apply( A080355(n)=1+sum(i=1,n-1,2^(prime(i)-1)), [1..50]) \\ M. F. Hasler, Oct 30 2018
    

Formula

a(n) = 1 + Sum_{k=1..n-1} 2^(prime(k)-1).
a(n) = A076793(n-1) / 2 + 1. - Georg Fischer, Aug 12 2023

Extensions

More terms from Vladeta Jovovic, Mar 26 2003

A135482 a(n) = (1/4)*Sum_{j=1..n} 2^prime(j).

Original entry on oeis.org

0, 1, 3, 11, 43, 555, 2603, 35371, 166443, 2263595, 136481323, 673352235, 35033090603, 584788904491, 2783812160043, 37968184248875, 2289767997934123, 146404956073789995, 722865708377213483, 37616353855796316715, 627912164214501968427, 2989095405649324575275
Offset: 0

Views

Author

Ctibor O. Zizka, Feb 07 2008

Keywords

Crossrefs

Partial sums of A135620.

Programs

  • Magma
    [&+[2^(NthPrime(k)-2): k in [1..n]]: n in [1..25]]; // Bruno Berselli, Sep 24 2015
    
  • Maple
    A135482:= n-> add(2^ithprime(i)/4, i=1..n): seq(A135482(n), n=0..20); # Wesley Ivan Hurt, Feb 02 2014
  • Mathematica
    Accumulate[Table[Floor[2^i/4],{i,Prime[Range[20]]}]] (* Harvey P. Dale, Dec 05 2013 *)
  • PARI
    a(n) = sum(k=1, n, 2^prime(k))/4; \\ Michel Marcus, Oct 15 2016

Formula

a(n) = A076793(n)/4. - M. F. Hasler, Oct 30 2018

Extensions

More terms from Harvey P. Dale, Dec 05 2013
a(0) = 0 prepended by M. F. Hasler, Oct 30 2018

A293390 Least m such that the exponents in expression for n as a sum of distinct powers of 2 are pairwise distinct mod m; a(0) = 0 by convention.

Original entry on oeis.org

0, 1, 1, 2, 1, 3, 2, 3, 1, 2, 3, 4, 2, 4, 3, 4, 1, 3, 2, 5, 3, 3, 4, 5, 2, 5, 4, 5, 3, 5, 4, 5, 1, 2, 3, 3, 2, 4, 5, 6, 3, 4, 3, 6, 4, 4, 5, 6, 2, 3, 5, 6, 4, 6, 5, 6, 3, 6, 5, 6, 4, 6, 5, 6, 1, 4, 2, 4, 3, 5, 3, 7, 2, 4, 4, 4, 5, 5, 6, 7, 3, 5, 4, 7, 3, 5, 6
Offset: 0

Views

Author

Rémy Sigrist, Oct 08 2017

Keywords

Comments

The set of exponents in expression for n as a sum of distinct powers of 2 corresponds to the n-th row of A133457.
The sum of digits of n in base 2^a(n), say s, can be computed without carry in base 2; the Hamming weight of s equals the Hamming weight of n.
a(n) >= A000120(n) for any n > 0.
Apparently, a(n) = A000120(n) iff n = 0 or n belongs to A100290.
a(n) <= A070939(n) for any n >= 0.
For any sequence s of distinct nonnegative integers (s(n) being defined for n >= 0):
- let D_s be defined for any n > 0 by D_s(n) = a(Sum_{k=0..n-1} 2^s(k)),
- then D_s is the discriminator of s as introduced by Arnold, Benkoski, and McCabe in 1985,
- D_s(1) = 1,
- D_s(n) >= n for any n >= 1,
- D_s(n+1) >= D_s(n) for any n >= 1.

Examples

			For n=42:
- 42 = 2^5 + 2^3 + 2^1,
- 5 mod 1 = 3 mod 1,
- 5 mod 2 = 3 mod 2,
- 5 mod 3, 3 mod 3 and 1 mod 3 are all distinct,
- hence a(42) = 3.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local L,D,k;
      L:= convert(n,base,2);
      L:= select(t -> L[t+1]=1, [$0..nops(L)-1]);
      if nops(L) = 1 then return 1 fi;
      D:= {seq(seq(L[j]-L[i],i=1..j-1),j=2..nops(L))};
      D:= `union`(seq(numtheory:-divisors(i),i=D));
      min({$2..max(D)+1} minus D)
    end proc:
    0, seq(f(i),i=1..100); # Robert Israel, Oct 08 2017
  • Mathematica
    {0}~Join~Table[Function[r, SelectFirst[Range@ 10, Length@ Union@ Mod[r, #] == Length@ r &]][Join @@ Position[#, 1] - 1 &@ Reverse@ IntegerDigits[n, 2]], {n, 86}] (* Michael De Vlieger, Oct 08 2017 *)
  • PARI
    a(n) = if (n, my (d=Vecrev(binary(n)), x = []); for (i=1, #d, if (d[i], x = concat(x, i-1))); for (m=1, oo, if (#Set(vector(#x, i, x[i]%m))==#x, return (m))), return (0))

Formula

a(2*n) = a(n) for any n >= 0.
a(2^k-1) = k for any k >= 0.
a(n) = 1 iff n = 2^k for some k >= 0.
a(n) = 2 iff n belongs to A173195.
a(Sum_{k=1..n} 2^(k^2)) = A016726(n) for any n >= 1.
a(Sum_{k=1..n} 2^A000069(k)) = A062383(n) for any n >= 1.
a(Sum_{k=0..n} 2^(2^k)) = A270097(n) for any n >= 0.
a(Sum_{k=1..n} 2^A000045(k+1)) = A270151(n) for any n >= 1.
a(Sum_{k=1..n} 2^A000041(k)) = A270176(n) for any n >= 1.
a(A076793(n)) = A272633(n) for any n >= 0.
a(Sum_{k=1..n} 2^A001969(k)) = A272881(n) for any n >= 1.
a(Sum_{k=1..n} 2^A005823(k)) = A272882(n) for any n >= 1.
a(Sum_{k=1..n} 2^A000215(k-1)) = A273037(n) for any n >= 1.
a(Sum_{k=1..n} 2^A000108(k)) = A273041(n) for any n >= 1.
a(Sum_{k=1..n} 2^A001566(k)) = A273043(n) for any n >= 1.
a(Sum_{k=1..n} 2^A003095(k)) = A273044(n) for any n >= 1.
a(Sum_{k=1..n} 2^A000058(k-1)) = A273056(n) for any n >= 1.
a(Sum_{k=1..n} 2^A002808(k)) = A273062(n) for any n >= 1.
a(Sum_{k=1..n} 2^(k!)) = A273064(n) for any n >= 1.
a(Sum_{k=1..n} 2^(k^k)) = A273068(n) for any n >= 1.
a(Sum_{k=1..n} 2^A000110(k)) = A273237(n) for any n >= 1.
a(Sum_{k=1..n} 2^A001147(k)) = A273377(n) for any n >= 1.

A076794 Numbers of the form Sum_{k=1..m} prime(r)^prime(k) for some values of m and r.

Original entry on oeis.org

4, 9, 12, 25, 36, 44, 49, 121, 150, 169, 172, 279, 289, 361, 392, 529, 841, 961, 1369, 1452, 1681, 1849, 2209, 2220, 2366, 2466, 2809, 3275, 3481, 3721, 4489, 5041, 5202, 5329, 6241, 6889, 7220, 7921, 9409, 10201, 10412, 10609, 11449, 11881, 12696, 12769
Offset: 1

Views

Author

Walter Carlini, Nov 17 2002

Keywords

Comments

Union of sets S(r) := { Sum_{k=1..m} prime(r)^prime(k) | m = 1, 2, ... } sorted in increasing order.

Crossrefs

Extensions

Corrected and extended by Arkadiusz Wesolowski, May 21 2013

A176496 a(n) = Sum_{k=1..n} 2^nonprime(k).

Original entry on oeis.org

2, 18, 82, 338, 850, 1874, 5970, 22354, 55122, 120658, 382802, 1431378, 3528530, 7722834, 24500050, 58054482, 125163346, 259381074, 527816530, 1601558354, 5896525650, 14486460242, 31666329426, 66026067794, 134745544530, 409623451474, 959379265362, 2058890893138
Offset: 1

Views

Author

David Lazar (lazar6(AT)illinois.edu), Apr 19 2010

Keywords

Examples

			a(2) = 2 + 2^A018252(2) = 2 + 2^4 = 18 ; a(3) = 18 + 2^A018252(3) = 18 + 2^6 = 82.
		

Crossrefs

Programs

  • Mathematica
    With[{t=Select[Range[50],!PrimeQ[#]&]},Accumulate[2^t]] (* Harvey P. Dale, Feb 14 2023 *)
  • PARI
    a(n) = my(s = 0, k = 1); while(n, if(!isprime(k), s += 2^k; n--); k++); return(s)

Formula

a(1) = 2, a(n) = a(n-1) + 2^A018252(n).

A320877 a(n) = 1 + Sum_{k=1..n} 2^prime(k).

Original entry on oeis.org

1, 5, 13, 45, 173, 2221, 10413, 141485, 665773, 9054381, 545925293, 2693408941, 140132362413, 2339155617965, 11135248640173, 151872736995501, 9159071991736493, 585619824295159981, 2891462833508853933, 150465415423185266861, 2511648656858007873709, 11956381622597298301101
Offset: 0

Views

Author

M. F. Hasler, Oct 30 2018

Keywords

Comments

Indices of noncomposite terms are 0, 1, 2, 4, 5, 8, 43, 127, 251, ...

Crossrefs

Cf. A076793.

Programs

  • Mathematica
    Join[{1},Accumulate[2^Prime[Range[30]]]+1] (* Harvey P. Dale, Mar 26 2019 *)
  • PARI
    apply( A320877(n)=1+sum(k=1,n,2^prime(k)), [0..30])

Formula

a(n) = A076793(n) + 1.

A333392 a(0) = 1; thereafter a(n) = 2^(prime(n)-1) + Sum_{k=1..n} 2^(prime(n)-prime(k)).

Original entry on oeis.org

1, 3, 7, 29, 117, 1873, 7493, 119889, 479557, 7672913, 491066433, 1964265733, 125713006913, 2011408110609, 8045632442437, 128730119078993, 8238727621055553, 527278567747555393, 2109114270990221573, 134983313343374180673, 2159733013493986890769, 8638932053975947563077
Offset: 0

Views

Author

Ilya Gutkovskiy, Mar 18 2020

Keywords

Examples

			a(7) = 119889 (in base 10) = 11101010001010001 (in base 2).
                             ||| | |   | |   |
                             123 5 7  1113  17
		

Crossrefs

Programs

  • Mathematica
    a[0] = 1; a[n_] := 2^(Prime[n] - 1) + Sum[2^(Prime[n] - Prime[k]), {k, 1, n}]; Table[a[n], {n, 0, 21}]
  • PARI
    a(n) = if (n==0, 1, 2^(prime(n)-1) + sum(k=1, n, 2^(prime(n)-prime(k)))); \\ Michel Marcus, Mar 18 2020

Formula

a(n) = floor(c * 2^prime(n)) for n > 0, where c = 0.91468250985... = 1/2 + A051006.

A289898 a(n) = floor((2^prime(n+1))/Sum_{k=0|n,2^prime(k)}).

Original entry on oeis.org

2, 2, 2, 11, 3, 12, 3, 12, 59, 3, 51, 15, 3, 12, 59, 62, 3, 51, 15, 3, 50, 15, 60, 251, 15, 3, 12, 3, 12, 15179, 15, 60, 3, 816, 3, 51, 62, 15, 60, 62, 3, 816, 3, 12, 3, 3226, 4094, 15, 3, 12, 59, 3, 816, 63, 63, 63, 3, 51, 15, 3, 808, 16363, 15, 3, 12, 15183
Offset: 1

Views

Author

Joseph Wheat, Jul 14 2017

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Floor[2^Prime[n + 1]/Sum[ 2^Prime[k], {k, n}]], {n, 66}] (* Michael De Vlieger, Jul 16 2017 *)
  • PARI
    a(n) = 2^prime(n+1)\sum(k=1, n, 2^prime(k)); \\ Michel Marcus, Jul 16 2017

Formula

a(n) = floor(2^prime(n+1)/(Sum_{k=1..n} 2^prime(k))).
Showing 1-8 of 8 results.