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 12 results. Next

A228085 a(n) = number of distinct k which satisfy n = k + wt(k), where wt(k) (A000120) gives the number of 1's in binary representation of a nonnegative integer k.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Aug 09 2013

Keywords

Comments

wt(k) is also called bitcount(k).
a(n) = number of times n occurs in A092391.
The first 2 occurs at n = A230303(2) = 5 (as we have two solutions A092391(3) = A092391(4) = 5).
The first 3 occurs at n = A230303(3) = 129 (as we have three solutions A092391(123) = A092391(124) = A092391(128) = 129).
The first 4 occurs at n = A230303(4) = 4102, where we have solutions A092391(4091) = A092391(4092) = A092391(4099) = A092391(4100) = 4102.
For n>=1, a(2^n) = a(n-1) since an integer k = m is a solution to n-1 = m + wt(m) if and only if k = 2^n - 1 - m is a solution to 2^n = k + wt(k). - Max Alekseyev, Feb 23 2021

Crossrefs

A010061 gives the position of zeros, A228082 the positions of nonzeros, A228088 the positions of ones.
Cf. A000120, A010062, A092391, A228086, A228087, A228091 (positions of 2's), A227643, A230058, A230092 (positions of 3's), A230093, A227915 (positions of 4's), A070939, A230303.

Programs

  • Haskell
    a228085 n = length $ filter ((== n) . a092391) [n - a070939 n .. n]
    -- Reinhard Zumkeller, Oct 13 2013
  • Maple
    For Maple code see A230091. - N. J. A. Sloane, Oct 10 2013
    # Find all inverses of m under x -> x + wt(x) - N. J. A. Sloane, Oct 19 2013
    A000120 := proc(n) local w, m, i; w := 0; m := n; while m > 0 do i := m mod 2; w := w+i; m := (m-i)/2; od; w; end: wt := A000120;
    F:=proc(m) local ans,lb,n,i;
    lb:=m-ceil(log(m+1)/log(2)); ans:=[];
    for n from max(1,lb) to m do if (n+wt(n)) = m then ans:=[op(ans),n]; fi; od:
    [seq(ans[i],i=1..nops(ans))];
    end;
  • Mathematica
    nmax = 8191; Clear[a]; a[_] = 0;
    Scan[Set[a[#[[1]]], #[[2]]]&, Tally[Table[n + DigitCount[n, 2, 1], {n, 0, nmax}]]];
    a /@ Range[0, nmax] (* Jean-François Alcover, Oct 29 2019 *)
    a[n_] := Module[{k, cnt = 0}, For[k = n - Floor[Log[2, n]] - 1, k < n, k++, If[n == k + DigitCount[k, 2, 1], cnt++]]; cnt];
    a /@ Range[0, 100] (* Jean-François Alcover, Nov 28 2020 *)

A230640 Let M(1)=0 and for n>1, B(n)=(M(ceiling(n/2))+M(floor(n/2))+2)/2, M(n)=3^B(n)+M(floor(n/2))+1. This sequence gives M(n).

Original entry on oeis.org

0, 4, 28, 248, 129140168, 68630377364912, 2088595827392656793085408064780643444068898148936888424953199350296
Offset: 1

Views

Author

N. J. A. Sloane, Oct 31 2013

Keywords

Crossrefs

Cf. A230639.
Related base-3 sequences: A053735, A134451, A230641, A230642, A230643, A230853, A230854, A230855, A230856, A230639, A230640, A010063 (trajectory of 1)
Smallest number m such that u + (sum of base-b digits of u) = m has exactly n solutions, for bases 2 through 10: A230303, A230640, A230638, A230867, A238840, A238841, A238842, A238843, A006064.

Programs

  • Maple
    f:=proc(n) option remember; local B, M;
    if n<=1 then RETURN([0, 0]);
    else
    B:=(f(ceil(n/2))[2] + f(floor(n/2))[2] + 2)/2;
    M:=3^B+f(floor(n/2))[2]+1; RETURN([B, M]); fi;
    end proc;
    [seq(f(n)[2], n=1..7)];

A006064 Smallest junction number with n generators.

Original entry on oeis.org

0, 101, 10000000000001, 1000000000000000000000102
Offset: 1

Views

Author

Keywords

Comments

Strictly speaking, a junction number is a number n with more than one solution to x+digitsum(x) = n. However, it seems best to start this sequence with n=0, for which there is just one solution, x=0. - N. J. A. Sloane, Oct 31 2013.
a(3) = 10^13 + 1 was found by Narasinga Rao, who reports that Kaprekar verified that it is the smallest term. No details of Kaprekar's proof were given.
a(4) = 10^24 + 102 was conjectured by Narasinga Rao.
a(5) = 10^1111111111124 + 102. - Conjectured by Narasinga Rao, confirmed by Max Alekseyev and N. J. A. Sloane.
a(6) = 10^2222222222224 + 10000000000002. - Max Alekseyev
a(7) = 10^( (10^24 + 10^13 + 115) / 9 ) + 10^13 + 2. - Max Alekseyev
a(8) = 10^( (2*10^24 + 214)/9 ) + 10^24 + 103. - Max Alekseyev

Examples

			a(2) = 101 since 101 is the smallest number with two generators: 101 = A062028(91) = A062028(100).
a(4) = 10^24 + 102 = 1000000000000000000000102 has exactly four inverses w.r.t. A062028, namely 999999999999999999999893, 999999999999999999999902, 1000000000000000000000091 and 1000000000000000000000100.
		

References

  • M. Gardner, Time Travel and Other Mathematical Bewilderments. Freeman, NY, 1988, p. 116.
  • D. R. Kaprekar, The Mathematics of the New Self Numbers, Privately printed, 311 Devlali Camp, Devlali, India, 1963.
  • Narasinga Rao, A. On a technique for obtaining numbers with a multiplicity of generators. Math. Student 34 1966 79--84 (1967). MR0229573 (37 #5147)
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A003052, A230093, A230100, A230303, A230857 (highest power of 10).
Smallest number m such that u + (sum of base-b digits of u) = m has exactly n solutions, for bases 2 through 10: A230303, A230640, A230638, A230867, A238840, A238841, A238842, A238843, A006064.

Formula

a(n) = the smallest m such that there are exactly n solutions to A062028(x)=m.

Extensions

Edited, a(5)-a(6) added by Max Alekseyev, Jun 01 2011
a(1) added, a(5) corrected, a(7)-a(8) added by Max Alekseyev, Oct 26 2013

A230638 Smallest number m such that u + (sum of base-4 digits of u) = m has exactly n solutions.

Original entry on oeis.org

0, 17, 16385, 16777234
Offset: 1

Views

Author

N. J. A. Sloane, Oct 31 2013

Keywords

Comments

Indices of records in A230632: a(n) is the index of the first n in A230632.
The terms are a(1)=0, a(2)=4^2+1, a(3)=4^7+1, a(4)=4^12+17+1, a(5)=4^5368+17+1, a(6)=4^10924+16385+1, a(7)=4^5597880+16385+20. Note that a(7) breaks the pattern of the first six terms.
a(8) = 4^16777229 + 4^12 + 19.
For the leading power of 4 see A230637.

Examples

			n=2: the two solutions to u+(base-4 digit-sum of u) = 17 are 13 and 16.
n=3: the three solutions to u+(base-4 digit-sum of u) = 4^7+1 are 4^7, 4^7-15, 4^7-18.
n=4: the four solutions to u+(base-4 digit-sum of u) = 4^12+17+1 are 4^12+{16, 13, -14, -17}.
		

Crossrefs

Cf. A230637.
Related base-4 sequences: A053737, A230631, A230632, A010064, A230633, A230634, A230635, A230636, A230637, A230638, A010065 (trajectory of 1)
Smallest number m such that u + (sum of base-b digits of u) = m has exactly n solutions, for bases 2 through 10: A230303, A230640, A230638, A230867, A238840, A238841, A238842, A238843, A006064.

Extensions

a(8) from Max Alekseyev, Oct 31 2013

A227915 Numbers of the form k + wt(k) for exactly four distinct k, where wt(k) = A000120(k) is the binary weight of k.

Original entry on oeis.org

4102, 12295, 20487, 28680, 36871, 45064, 53256, 61449, 69639, 77832, 86024, 94217, 102408, 110601, 118793, 126986, 135175, 143368, 151560, 159753, 167944, 176137, 184329, 192522, 200712, 208905, 217097, 225290, 233481, 241674, 249866, 258059, 266247, 274440, 282632, 290825, 299016, 307209, 315401, 323594, 331784, 339977
Offset: 1

Views

Author

Reinhard Zumkeller, Oct 13 2013

Keywords

Comments

Numbers occurring exactly four times in A092391: A228085(a(n)) = 4. For the first number that appears k times, see A230303.

Examples

			a(1) = 4102, the four k with A092391(k) = 4102 being:
4091 = '111111111011', A000120(4091) = 11, 4091 + 11 = 4102;
4092 = '111111111100', A000120(4092) = 12, 4092 + 10 = 4102;
4099 = '1000000000011', A000120(4099) = 3, 4099 + 3 = 4102;
4100 = '1000000000100', A000120(4100) = 2, 4100 + 2 = 4102.
		

Crossrefs

Programs

  • Haskell
    a227915 n = a227915_list !! (n-1)
    a227915_list = filter ((== 4) . a228085) [1..]

A230867 Smallest number m such that u + (sum of base-5 digits of u) = m has exactly n solutions.

Original entry on oeis.org

0, 6, 26, 632, 1953134, 30517578152
Offset: 1

Views

Author

N. J. A. Sloane, Nov 05 2013

Keywords

Comments

Indices of records in A230866: a(n) is the index of the first n in A230866.
The next two terms are a(7) = 5^165 + 27, a(8) = 5^317 + 633.

Examples

			a(5) = 1953134 corresponds to the five solutions:
1953099 (base-5: 444444344)
1953103 (base-5: 444444403)
1953105 (base-5: 444444410)
1953129 (base-5: 1000000004)
1953131 (base-5: 1000000011).
		

Crossrefs

A230868 gives the leading power of 5 in a(n).
Smallest number m such that u + (sum of base-b digits of u) = m has exactly n solutions, for bases 2 through 10: A230303, A230640, A230638, A230867, A238840, A238841, A238842, A238843, A006064.

Extensions

a(5) corrected by Donovan Johnson, Nov 05 2013

A238840 Smallest number m such that u + (sum of base-6 digits of u) = m has exactly n solutions.

Original entry on oeis.org

0, 37, 10077697, 2821109907494
Offset: 1

Views

Author

N. J. A. Sloane, Mar 19 2014

Keywords

Comments

The next term is a(5) = 6^((6^9+6^2+8)/5) + 38 = 6^2015548 + 38 and is too large to display.

Crossrefs

Smallest number m such that u + (sum of base-b digits of u) = m has exactly n solutions, for bases 2 through 10: A230303, A230640, A230638, A230867, A238840, A238841, A238842, A238843, A006064.

A238841 Smallest number m such that u + (sum of base-7 digits of u) = m has exactly n solutions.

Original entry on oeis.org

0, 8, 50, 352, 282475258, 232630513987258, 418377847259091645147530834859099334519176045887014771594
Offset: 1

Views

Author

N. J. A. Sloane, Mar 19 2014

Keywords

Crossrefs

Smallest number m such that u + (sum of base-b digits of u) = m has exactly n solutions, for bases 2 through 10: A230303, A230640, A230638, A230867, A238840, A238841, A238842, A238843, A006064.

A238842 Smallest number m such that u + (sum of base-8 digits of u) = m has exactly n solutions.

Original entry on oeis.org

0, 65, 8589934593, 1152921504606847042
Offset: 1

Views

Author

N. J. A. Sloane, Mar 19 2014

Keywords

Comments

The next term is a(5) = 8^((8^11+76)/7) + 66 = 8^1227133524 + 66 and is too large to display.

Crossrefs

Smallest number m such that u + (sum of base-b digits of u) = m has exactly n solutions, for bases 2 through 10: A230303, A230640, A230638, A230867, A238840, A238841, A238842, A238843, A006064.

A238843 Smallest number m such that u + (sum of base-9 digits of u) = m has exactly n solutions.

Original entry on oeis.org

0, 10, 82, 740, 282429536492, 109418989131512359292, 193632597890512706847971583764083347958511186984324587565465147107798425867049291402906445603076812
Offset: 1

Views

Author

N. J. A. Sloane, Mar 19 2014

Keywords

Crossrefs

Smallest number m such that u + (sum of base-b digits of u) = m has exactly n solutions, for bases 2 through 10: A230303, A230640, A230638, A230867, A238840, A238841, A238842, A238843, A006064.
Showing 1-10 of 12 results. Next