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.

A353366 Dirichlet inverse of A110963, which is a fractalization of Kimberling's paraphrases sequence (A003602).

Original entry on oeis.org

1, -1, -1, 0, -2, 1, -1, 0, -2, 2, -2, 0, -4, 1, 3, 0, -5, 2, -3, 0, -4, 2, -2, 0, -3, 4, 1, 0, -8, -3, -1, 0, -5, 5, -1, 0, -10, 3, 5, 0, -11, 4, -6, 0, -4, 2, -2, 0, -12, 3, 3, 0, -14, -1, 4, 0, -9, 8, -8, 0, -16, 1, 14, 0, -1, 5, -9, 0, -14, 1, -5, 0, -19, 10, -4, 0, -16, -5, -3, 0, -12, 11, -11, 0, -2, 6, 10
Offset: 1

Views

Author

Antti Karttunen, Apr 18 2022

Keywords

Crossrefs

Programs

  • PARI
    up_to = 65537;
    DirInverseCorrect(v) = { my(u=vector(#v)); u[1] = (1/v[1]); for(n=2, #v, u[n] = (-u[1]*sumdiv(n, d, if(dA003602(n) = (1+(n>>valuation(n,2)))/2;
    A110963(n) = if(n%2, A003602((1+n)/2), A110963(n/2));
    v353366 = DirInverseCorrect(vector(up_to,n,A110963(n)));
    A353366(n) = v353366[n];
    
  • Python
    from functools import lru_cache
    from sympy import divisors
    @lru_cache(maxsize=None)
    def A353366(n): return 1 if n==1 else -sum(((1+(m:=d>>(~d&d-1).bit_length())>>(m+1&-m-1).bit_length())+1)*A353366(n//d) for d in divisors(n,generator=True) if d>1) # Chai Wah Wu, Jan 04 2024

Formula

a(1) = 1; a(n) = -Sum_{d|n, d < n} A110963(n/d) * a(d).
a(n) = A353367(n) - A110963(n).

A353367 Sum of A110963 and its Dirichlet inverse.

Original entry on oeis.org

2, 0, 0, 1, 0, 2, 0, 1, 1, 4, 0, 1, 0, 2, 4, 1, 0, 5, 0, 2, 2, 4, 0, 1, 4, 8, 5, 1, 0, -2, 0, 1, 4, 10, 4, 3, 0, 6, 8, 2, 0, 10, 0, 2, 8, 4, 0, 1, 1, 10, 10, 4, 0, 3, 8, 1, 6, 16, 0, 1, 0, 2, 15, 1, 16, 14, 0, 5, 4, 6, 0, 3, 0, 20, 6, 3, 4, -2, 0, 2, 9, 22, 0, 6, 20, 12, 16, 2, 0, 16, 8, 2, 2, 4, 12, 1, 0, 25, 24
Offset: 1

Views

Author

Antti Karttunen, Apr 18 2022

Keywords

Comments

Note the negative terms, in contrast to A349135, which apparently has none.

Crossrefs

Programs

  • PARI
    up_to = 65537;
    DirInverseCorrect(v) = { my(u=vector(#v)); u[1] = (1/v[1]); for(n=2, #v, u[n] = (-u[1]*sumdiv(n, d, if(dA003602(n) = (1+(n>>valuation(n,2)))/2;
    A110963(n) = if(n%2, A003602((1+n)/2), A110963(n/2));
    v353366 = DirInverseCorrect(vector(up_to,n,A110963(n)));
    A353366(n) = v353366[n];
    A353367(n) = (A110963(n)+A353366(n));

Formula

a(n) = A110963(n) + A353366(n).
For n > 1, a(n) = -Sum_{d|n, 1A110963(d) * A353366(n/d).
For all n >= 1, a(4*n) = A110963(n), and a(8*n-4) = A003602(n).

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

A103391 "Even" fractal sequence for the natural numbers: Deleting every even-indexed term results in the same sequence.

Original entry on oeis.org

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

Views

Author

Eric Rowland, Mar 20 2005

Keywords

Comments

A003602 is the "odd" fractal sequence for the natural numbers.
Lexicographically earliest infinite sequence such that a(i) = a(j) => A348717(A005940(i)) = A348717(A005940(j)) for all i, j >= 1. A365718 is an analogous sequence related to A356867 (Doudna variant D(3)). - Antti Karttunen, Sep 17 2023

Crossrefs

Cf. A003602, A005940, A025480, A220466, A286387, A353368 (Dirichlet inverse).
Cf. also A110962, A110963, A365718.
Differs from A331743(n-1) for the first time at n=192, where a(192) = 97, while A331743(191) = 23.
Differs from A351460.

Programs

  • Haskell
    -- import Data.List (transpose)
    a103391 n = a103391_list !! (n-1)
    a103391_list = 1 : ks where
       ks = concat $ transpose [[2..], ks]
    -- Reinhard Zumkeller, May 23 2013
    
  • Maple
    nmax := 82: for p from 0 to ceil(simplify(log[2](nmax))) do for n from 2 to ceil(nmax/(p+2))+1 do a((2*n-3)*2^p+1) := n od: od: a(1) := 1: seq(a(n), n=1..nmax); # Johannes W. Meijer, Jan 28 2013
  • Mathematica
    a[n_] := ((n-1)/2^IntegerExponent[n-1, 2] + 3)/2; a[1] = 1; Array[a, 100] (* Amiram Eldar, Sep 24 2023 *)
  • PARI
    A003602(n) = (n/2^valuation(n, 2)+1)/2; \\ From A003602
    A103391(n) = if(1==n,1,(1+A003602(n-1))); \\ Antti Karttunen, Feb 05 2020
    
  • Python
    def v(n): b = bin(n); return len(b) - len(b.rstrip("0"))
    def b(n): return (n//2**v(n)+1)//2
    def a(n): return 1 if n == 1 else 1 + b(n-1)
    print([a(n) for n in range(1, 106)]) # Michael S. Branicky, May 29 2022
    
  • Python
    def A103391(n): return (n-1>>(n-1&-n+1).bit_length())+2 if n>1 else 1 # Chai Wah Wu, Jan 04 2024

Formula

For n > 1, a(n) = A003602(n-1) + 1. - Benoit Cloitre, May 26 2007, indexing corrected by Antti Karttunen, Feb 05 2020
a((2*n-3)*2^p+1) = n, p >= 0 and n >= 2, with a(1) = 1. - Johannes W. Meijer, Jan 28 2013
Sum_{k=1..n} a(k) ~ n^2/6. - Amiram Eldar, Sep 24 2023

Extensions

Data section extended up to a(105) (to better differentiate from several nearby sequences) by Antti Karttunen, Feb 05 2020

A110962 Fractalization of A025480, zero-based version of Kimberling's paraphrases sequence.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 0, 2, 1, 1, 0, 3, 0, 0, 0, 4, 2, 2, 1, 5, 1, 1, 0, 6, 3, 3, 0, 7, 0, 0, 0, 8, 4, 4, 2, 9, 2, 2, 1, 10, 5, 5, 1, 11, 1, 1, 0, 12, 6, 6, 3, 13, 3, 3, 0, 14, 7, 7, 0, 15, 0, 0, 0, 16, 8, 8, 4, 17, 4, 4, 2, 18, 9, 9, 2, 19, 2, 2, 1, 20, 10, 10, 5, 21, 5, 5, 1, 22, 11, 11, 1, 23, 1, 1, 0, 24, 12, 12
Offset: 0

Views

Author

Alexandre Wajnberg, Sep 26 2005

Keywords

Comments

Self-descriptive sequence: the terms at odd indices are the sequence itself, while the terms at even indices (the skeleton of this sequence) are the terms of A025480, which is a zero-based sequence of Kimberling's paraphrases sequence, A003602.

Crossrefs

One less than A110963 (note also the different starting offsets).

Programs

Formula

For even n, a(n) = A025480(n/2), for odd n, a(n) = a((n-1)/2). - Antti Karttunen, Apr 18 2022
a(2n+1) = a(4n+3) = a(n).
a(2n) = a(4n+1) = a(4n+2) = A025480(n/2).
a(4n) = a(8n+1) = a(8n+2) = n.
a(n) = A110963(1+n) - 1.

Extensions

Entry edited and more terms added by Antti Karttunen, Apr 18 2022
Showing 1-5 of 5 results.