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.

A020949 Least k such that A(k) = n, where A( ) is sequence A020945.

Original entry on oeis.org

1, 4, 11, 10, 20, 24, 22, 42, 89, 44, 46, 84, 100, 88, 96, 90, 92, 204, 170, 202, 192, 190, 178, 184, 180, 188, 186, 338, 382, 340, 366, 354, 358, 390, 360, 356, 376, 364, 674, 362, 378, 680, 372, 676, 684, 710, 812, 682, 752, 708, 810, 1346, 732
Offset: 1

Views

Author

Keywords

Crossrefs

A020947 Least k such that A(k) = n, where A( ) is sequence A020943.

Original entry on oeis.org

2, 6, 15, 14, 28, 61, 30, 58, 121, 60, 62, 116, 241, 120, 245, 122, 124, 469, 234, 806, 509, 254, 242, 248, 244, 252, 250, 466, 510, 468, 494, 482, 486, 977, 488, 484, 504, 492, 930, 490, 506, 936, 500, 932, 940, 966
Offset: 1

Views

Author

Keywords

Crossrefs

A020946 a(n) is the smallest number k such that A002487(k) = n.

Original entry on oeis.org

0, 1, 3, 5, 9, 11, 33, 19, 21, 35, 39, 37, 45, 43, 69, 73, 93, 77, 75, 83, 189, 85, 141, 139, 153, 151, 147, 155, 267, 149, 165, 173, 279, 275, 171, 283, 315, 277, 537, 325, 297, 293, 579, 301, 309, 365, 333, 299, 567, 331, 339, 553, 549, 563, 1275, 341, 585, 565, 615, 629
Offset: 0

Views

Author

N. J. A. Sloane and David W. Wilson, Jun 27 2002

Keywords

Examples

			A002487(33) = 6 and this is the first time 6 appears, so a(6) = 33.
		

Crossrefs

Programs

  • Mathematica
    aa = {}; a[0] = 0; a[1] = 1; a[n_] := a[n] = If[EvenQ[n], a[n/2], a[(n - 1)/2] + a[(n + 1)/2]]; Do[k = 0; While[a[k] != p, k++]; AppendTo[aa, k], {p, 0, 100}]; aa (* Artur Jasinski, Dec 06 2010 *)
  • PARI
    fusc(n)={my(a=1, b=0);while(n,if(bitand(n, 1), b+=a, a+=b);n>>=1); b};
    list(N)={
        my(v=vector(N),k);
        forstep(n=1,9e99,2,
            k=fusc(n);
            if(k<=N && !v[k],
                v[k]=n;
                if(vecmin(v),return(v))
            )
        )
    }; \\ Charles R Greathouse IV, Dec 20 2011
    
  • Python
    from itertools import count
    from functools import reduce
    def A020946(n): return next(filter(lambda k:sum(reduce(lambda x,y:(x[0],x[0]+x[1]) if int(y) else (x[0]+x[1],x[1]),bin(k)[-1:2:-1],(1,0)))==n,count(1))) if n else 0 # Chai Wah Wu, May 05 2023

A020948 Least k such that b(k) = n, where b( ) is sequence A020944.

Original entry on oeis.org

1, 8, 16, 32, 34, 128, 66, 68, 130, 134, 132, 140, 138, 260, 264, 284, 268, 266, 274, 572, 276, 524, 522, 536, 534, 530, 538, 1034, 532, 548, 556, 1046, 1042, 554, 1050, 1082, 1044, 2072, 1092, 1064, 1060, 2114, 1068, 1076, 1132, 1100, 1066, 2102, 1098, 1106, 2088, 2084, 2098, 4346, 1108
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := a[n] = Which[n < 2, Boole[n == 1] - Boole[n == 0], OddQ[n], Abs[a[n - 1] - a[n - 2]], True, a[n/2] + a[n/2 - 1]]; s = Array[a[#] &, 4200]; Array[FirstPosition[s, #][[1]] &, LengthWhile[Differences@ Union@ s, # == 1 &]] (* Michael De Vlieger, Feb 18 2022, after Michael Somos at A020944 *)

Extensions

More terms from Seiichi Manyama, Feb 18 2022
Showing 1-4 of 4 results.