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.

A320840 Smallest N such that A092391(k) >= n for all k >= N.

Original entry on oeis.org

0, 1, 1, 2, 3, 3, 5, 5, 6, 7, 9, 9, 10, 11, 11, 13, 13, 14, 17, 17, 18, 19, 19, 21, 21, 22, 23, 25, 25, 26, 27, 27, 29, 29, 33, 33, 34, 35, 35, 37, 37, 38, 39, 41, 41, 42, 43, 43, 45, 45, 46, 49, 49, 50, 51, 51, 53, 53, 54, 55, 57, 57, 58, 59, 59, 61, 65, 65
Offset: 0

Views

Author

Jianing Song, Oct 22 2018

Keywords

Comments

For n >= 2, a(n) <= n - 1, and is exactly n - 1 for all n = 2^t + 2.
Consider the diverging sum Sum_{k>=0} 4^k/k!. For k >= a(n), v(4^k/k!, 2) = A092391(k) >= n. As a result, the sum contains only finitely many nonzero terms (and thus converges) modulo 2^n for all n, that is, it converges in the 2-adic field. Here v(k, 2) is the 2-adic valuation of k.

Examples

			a(33) = 29 because A092391(28) = 31 < 33, A092391(29) = 33, A092391(30) = 34, A092391(31) = 36 and A092391(32) = 33. The smallest N such that A092391(k) >= 33 for all k >= N is N = 29.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{i = n-1-Boole[n >= 2]}, While[i+Total[IntegerDigits[i, 2]] >= n, i--]; i+1]; a[0]=0; Table[a[n], {n, 0, 67}] (* Jean-François Alcover, Nov 23 2018, from PARI *)
  • PARI
    a(n) = if(n, my(i=n-1-(n>=2)); while(i+hammingweight(i)>=n, i--); i+1, 0)