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

A003602 Kimberling's paraphrases: if n = (2k-1)*2^m then a(n) = k.

Original entry on oeis.org

1, 1, 2, 1, 3, 2, 4, 1, 5, 3, 6, 2, 7, 4, 8, 1, 9, 5, 10, 3, 11, 6, 12, 2, 13, 7, 14, 4, 15, 8, 16, 1, 17, 9, 18, 5, 19, 10, 20, 3, 21, 11, 22, 6, 23, 12, 24, 2, 25, 13, 26, 7, 27, 14, 28, 4, 29, 15, 30, 8, 31, 16, 32, 1, 33, 17, 34, 9, 35, 18, 36, 5, 37, 19, 38, 10, 39, 20, 40, 3, 41, 21, 42
Offset: 1

Views

Author

Keywords

Comments

Fractal sequence obtained from powers of 2.
k occurs at (2*k-1)*A000079(m), m >= 0. - Robert G. Wilson v, May 23 2006
Sequence is T^(oo)(1) where T is acting on a word w = w(1)w(2)..w(m) as follows: T(w) = "1"w(1)"2"w(2)"3"(...)"m"w(m)"m+1". For instance T(ab) = 1a2b3. Thus T(1) = 112, T(T(1)) = 1121324, T(T(T(1))) = 112132415362748. - Benoit Cloitre, Mar 02 2009
Note that iterating the post-numbering operator U(w) = w(1) 1 w(2) 2 w(3) 3... produces the same limit sequence except with an additional "1" prepended, i.e., 1,1,1,2,1,3,2,4,... - Glen Whitney, Aug 30 2023
In the binary expansion of n, first swallow all zeros from the right, then add 1, and swallow the now-appearing 0 bit as well. - Ralf Stephan, Aug 22 2013
Although A264646 and this sequence initially agree in their digit-streams, they differ after 48 digits. - N. J. A. Sloane, Nov 20 2015
"[This is a] fractal because we get the same sequence after we delete from it the first appearance of all positive integers" - see Cobeli and Zaharescu link. - Robert G. Wilson v, Jun 03 2018
From Peter Munn, Jun 16 2022: (Start)
The sequence is the list of positive integers interleaved with the sequence itself. Provided the offset is suitable (which is the case here) a term of such a self-interleaved sequence is determined by the odd part of its index. Putting some of the formulas given here into words, a(n) is the position of the odd part of n in the list of odd numbers.
Applying the interleaving transform again, we get A110963.
(End)
Omitting all 1's leaves A131987 + 1. - David James Sycamore, Jul 26 2022
a(n) is also the smallest positive number not among the terms between a(a(n-1)) and a(n-1) inclusive (with a(0)=1 prepended). - Neal Gersh Tolunsky, Mar 07 2023

Examples

			From _Peter Munn_, Jun 14 2022: (Start)
Start of table showing the interleaving with the positive integers:
   n  a(n)  (n+1)/2  a(n/2)
   1    1      1
   2    1               1
   3    2      2
   4    1               1
   5    3      3
   6    2               2
   7    4      4
   8    1               1
   9    5      5
  10    3               3
  11    6      6
  12    2               2
(End)
		

References

  • Michel Rigo, Formal Languages, Automata and Numeration Systems, 2 vols., Wiley, 2014. Mentions this sequence - see "List of Sequences" in Vol. 2.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

a(n) is the index of the column in A135764 where n appears (see also A054582).
Cf. A000079, A000265, A001511, A003603, A003961, A014577 (with offset 1, reduction mod 2), A025480, A035528, A048673, A101279, A110963, A117303, A126760, A181988, A220466, A249745, A253887, A337821 (2-adic valuation).
Cf. also A349134 (Dirichlet inverse), A349135 (sum with it), A349136 (Möbius transform), A349431, A349371 (inverse Möbius transform).
Cf. A264646.

Programs

  • Haskell
    a003602 = (`div` 2) . (+ 1) . a000265
    -- Reinhard Zumkeller, Feb 16 2012, Oct 14 2010
    
  • Haskell
    import Data.List (transpose)
    a003602 = flip div 2 . (+ 1) . a000265
    a003602_list = concat $ transpose [[1..], a003602_list]
    -- Reinhard Zumkeller, Aug 09 2013, May 23 2013
    
  • Maple
    A003602:=proc(n) options remember: if n mod 2 = 1 then RETURN((n+1)/2) else RETURN(procname(n/2)) fi: end proc:
    seq(A003602(n), n=1..83); # Pab Ter
    nmax := 83: for m from 0 to ceil(simplify(log[2](nmax))) do for k from 1 to ceil(nmax/(m+2)) do a((2*k-1)*2^m) := k od: od: seq(a(k), k=1..nmax); # Johannes W. Meijer, Feb 04 2013
    A003602 := proc(n)
        a := 1;
        for p in ifactors(n)[2] do
            if op(1,p) > 2 then
                a := a*op(1,p)^op(2,p) ;
            end if;
        end do  :
        (a+1)/2 ;
    end proc: # R. J. Mathar, May 19 2016
  • Mathematica
    a[n_] := Block[{m = n}, While[ EvenQ@m, m /= 2]; (m + 1)/2]; Array[a, 84] (* or *)
    a[1] = 1; a[n_] := a[n] = If[OddQ@n, (n + 1)/2, a[n/2]]; Array[a, 84] (* Robert G. Wilson v, May 23 2006 *)
    a[n_] := Ceiling[NestWhile[Floor[#/2] &, n, EvenQ]/2]; Array[a, 84] (* Birkas Gyorgy, Apr 05 2011 *)
    a003602 = {1}; max = 7; Do[b = {}; Do[AppendTo[b, {k, a003602[[k]]}], {k, Length[a003602]}]; a003602 = Flatten[b], {n, 2, max}]; a003602 (* L. Edson Jeffery, Nov 21 2015 *)
  • PARI
    A003602(n)=(n/2^valuation(n,2)+1)/2; /* Joerg Arndt, Apr 06 2011 */
    
  • Python
    import math
    def a(n): return (n/2**int(math.log(n - (n & n - 1), 2)) + 1)/2 # Indranil Ghosh, Apr 24 2017
    
  • Python
    def A003602(n): return (n>>(n&-n).bit_length())+1 # Chai Wah Wu, Jul 08 2022
  • Scheme
    (define (A003602 n) (let loop ((n n)) (if (even? n) (loop (/ n 2)) (/ (+ 1 n) 2)))) ;; Antti Karttunen, Feb 04 2015
    

Formula

a(n) = (A000265(n) + 1)/2.
a((2*k-1)*2^m) = k, for m >= 0 and k >= 1. - Robert G. Wilson v, May 23 2006
Inverse Weigh transform of A035528. - Christian G. Bower
G.f.: 1/x * Sum_{k>=0} x^2^k/(1-2*x^2^(k+1) + x^2^(k+2)). - Ralf Stephan, Jul 24 2003
a(2*n-1) = n and a(2*n) = a(n). - Pab Ter (pabrlos2(AT)yahoo.com), Oct 25 2005
a(A118413(n,k)) = A002024(n,k); = a(A118416(n,k)) = A002260(n,k); a(A014480(n)) = A001511(A014480(n)). - Reinhard Zumkeller, Apr 27 2006
Ordinal transform of A001511. - Franklin T. Adams-Watters, Aug 28 2006
a(n) = A249745(A126760(A003961(n))) = A249745(A253887(A048673(n))). That is, this sequence plays the same role for the numbers in array A135764 as A126760 does for the odd numbers in array A135765. - Antti Karttunen, Feb 04 2015 & Jan 19 2016
G.f. satisfies g(x) = g(x^2) + x/(1-x^2)^2. - Robert Israel, Apr 24 2015
a(n) = A181988(n)/A001511(n). - L. Edson Jeffery, Nov 21 2015
a(n) = A025480(n-1) + 1. - R. J. Mathar, May 19 2016
a(n) = A110963(2n-1) = A349135(4*n). - Antti Karttunen, Apr 18 2022
a(n) = (1 + n)/2, for n odd; a(n) = a(n/2), for n even. - David James Sycamore, Jul 28 2022
a(n) = n/2^A001511(n) + 1/2. - Alan Michael Gómez Calderón, Oct 06 2023
a(n) = A123390(A118319(n)). - Flávio V. Fernandes, Mar 02 2025

Extensions

More terms from Pab Ter (pabrlos2(AT)yahoo.com), Oct 25 2005

A333234 Nonprimes describing the nonprime digits' positions in a way explained in the Comments section.

Original entry on oeis.org

20, 40, 34, 64, 76, 84, 200, 106, 300, 118, 210, 270, 248, 124, 140, 324, 221, 231, 261, 338, 150, 170, 186, 364, 384, 341, 390, 371, 424, 451, 161, 481, 506, 511, 548, 570, 600, 551, 581, 611, 628, 636, 656, 664, 688, 714, 694, 749, 721, 750, 794
Offset: 1

Views

Author

Eric Angelini and Carole Dubois, Mar 12 2020

Keywords

Comments

"20" must be read: "At position 2, there is a 0". And indeed, there is, when considering the sequence as a string of concatenated digits;
"40" reads: "At position 4, there is a 0" - which is true;
"34" reads: "At position 3, there is a 4" - which is also true;
...
"200" reads: "At position 20, there is a 0" - which is true (the central 0 in 300); etc.

Crossrefs

Cf. A264646.

A333085 Sequence of primes in which each term a(n) = 10*i + d gives the position i and value d of a digit in the concatenation of all terms (see comments).

Original entry on oeis.org

11, 41, 61, 83, 113, 101, 151, 181, 233, 223, 263, 293, 353, 383, 419, 401, 479, 467, 541, 1009, 599, 631, 661, 691, 727, 751, 787, 797, 809, 877, 907, 919, 967, 991, 9001, 1031, 1063, 1151, 1171, 1187, 1201, 1237, 1303, 1321, 1361, 1373, 1453, 1481, 1597, 1601
Offset: 1

Views

Author

Eric Angelini and Hans Havermann, Mar 07 2020

Keywords

Comments

a(n) = p says "In position 'floor(p/10)' is a digit 'p mod 10'."
Each term must be the smallest possible prime not used earlier.
a(1447) = 19173719153, a(3868) = 371379371929.
No further record value up to n = 10^4. Some earlier record values: a(19) = 541, a(20) = 1009, a(35) = 9001, a(110) = 10007, ..., a(142) = 30011, ..., a(278) = 70001, ..., a(474) = 90001, a(523) = 101009, a(657) = 191339, a(902) = 300007, ..., a(1386) = 300221. - M. F. Hasler, Mar 19 2020

Examples

			a(1) = 11 says "In position 1 is a 1" - which is compatible with the term itself. Since any term must have at least two digits, this is certainly the smallest possibility.
a(2) = 41 says "In position 4 is a 1" - which is indeed the last digit of a(2). There is no smaller solution: the term cannot refer to the 2nd nor the 3rd digit of the sequence, since neither 21 nor 33 is prime.
a(3) = 61 says "In position 6 is a 1"; again, there's no smaller solution.
a(4) = 83 says "In position 8 is a 3", and this is again the smallest solution.
a(5) = 113 says "In position 11 is a 3": again the last digit of a(5) itself, and there is no smaller solution.
a(6) = 101 says: "In position 10 is a 1." (This term wasn't possible earlier, but at this position it is.)
a(19) = 541 says "In position 54 there is a 1", which is not yet there: position 54 is the first digit of a(20). So a(20) must start with a digit 1, and the smallest solution is a(20) = 1009, predicting a digit 9 in position 100.
		

Crossrefs

Cf. A264646 (n concatenated with the n-th digit of S).

Programs

  • PARI
    A333085_vec(n,d=[],U=[],F=[],k)={vector(n,i, forprime(p=11,, setsearch(U,p)&& next; k=divrem(p,10); k[1] > #d + logint(k[1],10)+1 || k[2] == if( k[1]<=#d, d[ k[1]], digits( k[1] )[ k[1]-#d ]) || next; for(i=1, #F, F[i][1] > #d + logint(p,10)+1 && break; F[i][2] == digits(p)[ F[i][1]-#d ] || next(2)); d=concat(d,digits(p)); break); while(#F && F[1][1]<=#d, F=F[^1]); k[1]>#d && F=setunion(F,[k]); U=setunion(U,primes([k[1],k[1]+1]*10)); [10,1]*k)} \\ For n > 500, use the much faster code given in LINKS. - M. F. Hasler, Mar 18 2020

Extensions

Edited by M. F. Hasler, Mar 18 2020

A333356 Terms describing the nonprime digits' positions in the way explained in the Comments section.

Original entry on oeis.org

11, 21, 41, 54, 61, 84, 96, 101, 118, 124, 139, 146, 151, 160, 171, 181, 191, 208, 211, 234, 241, 269, 271, 284, 296, 301, 321, 331, 346, 350, 361, 381, 391, 408, 411, 421, 439, 441, 460, 478, 491, 501, 534, 554, 561, 586, 599, 621, 648, 654, 679, 686, 700, 711, 741, 771, 794, 806, 830, 856, 861, 888
Offset: 1

Views

Author

Carole Dubois and Eric Angelini, Mar 15 2020

Keywords

Comments

"11" must be read: "At position 1, there is a 1". And indeed, there is, when considering the sequence as a string of concatenated digits;
"21" reads: "At position 2, there is a 1" - which is true;
"41" reads: "At position 4, there is a 1" - which is also true;
"54" reads: "At position 5, there is a 4" - which is also true;
...
"101" reads: "At position 10, there is a 1" - which is true (the 1 in 61); etc.
We don't read the 2 of 21 as this 2 is a prime digit. Thus 32 and 75 are not in the sequence.

Crossrefs

Cf. A333234 (nonprimes describing the nonprime digits' positions), A264646 (n concatenated with the n-th digit of S).

A342164 A self-describing sequence: start with 0, then for each digit in each successive term, starting from the first term, append to the sequence its most recent position in the string formed by the concatenation of all previous terms.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 15, 17, 19, 16, 23, 18, 27, 30, 27, 22, 27, 24, 39, 41, 44, 28, 47, 50, 41, 52, 56, 50, 56, 56, 56, 50, 56, 53, 72, 42, 75, 54, 80, 80, 76, 83, 80, 85, 92, 90, 80, 54, 99, 94, 99, 86, 99, 98, 99, 108, 99, 108, 99, 108, 99, 126, 99
Offset: 0

Views

Author

Scott R. Shannon, Mar 03 2021

Keywords

Comments

After the leading zero taking the a(n)-th digit of the sequence returns the digits of the sequence.

Examples

			The second term is 1 as the 0 in the first term appears as the first digit in the sequence. Likewise the third term is 2 as the 1 in the second term is the second digit of the sequence, and so on to the eleventh term.
As the eleventh term is 10 and has two digits, the twelfth and thirteenth terms give the most recent position of a 1 and 0 in the sequence, and they appear at the eleventh and twelfth position.
As the twelfth term is 11, the fourteenth and fifteenth terms give the most recent position of the two 1's. The last 1 appears at the fifteenth position, and after appending 15, which contains a 1, the most recent 1 now appears at the seventeenth position.
		

Crossrefs

Showing 1-5 of 5 results.