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

A250120 Coordination sequence for planar net 3.3.3.3.6 (also called the fsz net).

Original entry on oeis.org

1, 5, 9, 15, 19, 24, 29, 33, 39, 43, 48, 53, 57, 63, 67, 72, 77, 81, 87, 91, 96, 101, 105, 111, 115, 120, 125, 129, 135, 139, 144, 149, 153, 159, 163, 168, 173, 177, 183, 187, 192, 197, 201, 207, 211, 216, 221, 225, 231, 235
Offset: 0

Views

Author

N. J. A. Sloane, Nov 23 2014

Keywords

Comments

There are eleven uniform (or Archimedean) tilings (or planar nets), with vertex symbols 3^6, 3^4.6, 3^3.4^2, 3^2.4.3.4, 4^4, 3.4.6.4, 3.6.3.6, 6^3, 3.12^2, 4.6.12, and 4.8^2. Grünbaum and Shephard (1987) is the best reference.
a(n) is the number of vertices at graph distance n from any fixed vertex.
The Mathematica notebook can compute 30 or 40 iterations, and colors them with period 5. You could also change out images if you want to. These graphs are better for analyzing 5-iteration chunks of the pattern. You can see that under iteration all fragments of the circumferences are preserved in shape and translated outwards a distance approximately sqrt(21) (relative to small triangle edge), the length of a long diagonal of larger rhombus unit cell. The conjectured recurrence should follow from an analysis of how new pieces occur in between the translated pieces. - Bradley Klee, Nov 26 2014

References

  • Branko Grünbaum and G. C. Shephard, Tilings and Patterns. W. H. Freeman, New York, 1987, Fig. 2.1.5, p. 63.
  • Marjorie Senechal, Quasicrystals and geometry, Cambridge University Press, Cambridge, 1995, Fig. 1.10, Section 1.3, pp. 13-16.

Crossrefs

List of coordination sequences for uniform planar nets: A008458 (the planar net 3.3.3.3.3.3), A008486 (6^3), A008574 (4.4.4.4 and 3.4.6.4), A008576 (4.8.8), A008579 (3.6.3.6), A008706 (3.3.3.4.4), A072154 (4.6.12), A219529 (3.3.4.3.4), A250120 (3.3.3.3.6), A250122 (3.12.12).
For partial sums of the present sequence, see A250121.

Programs

  • C
    /* Comments on the C program (see link) from Maurizio Paolini, Nov 23 2014: Basically what I do is deform the net onto the integral lattice, connect nodes aligned either horizontally, vertically or diagonally from northeast to southwest, marking as UNREACHABLE the nodes with coordinates (i, j) satisfying i + 2*j = 0 mod 7. Then the code computes the distance from each node to the central node of the grid. */
  • Mathematica
    CoefficientList[Series[(x^2+x+1)(x^4+3x^3+3x+1)/((x^4+x^3+x^2+x+1)(x-1)^2), {x, 0, 80}], x] (* or *) LinearRecurrence[{1, 0, 0, 0, 1, -1}, {1, 5, 9, 15, 19, 24, 29}, 60] (* Harvey P. Dale, May 05 2018 *)

Formula

Based on the computations of Darrah Chavey, Bradley Klee, and Maurizio Paolini, there is a strong conjecture that the first differences of this sequence are 4, 4, 6, 4, 5, 5, 4, 6, 4, 5, 5, 4, 6, 4, 5, 5, ..., that is, 4 followed by (4,6,4,5,5) repeated.
This would imply that the sequence satisfies the recurrence:
for n > 2, a(n) = a(n-1) + { n == 0,3 (mod 5), 4; n == 4 (mod 5), 6; n == 1,2 (mod 5), 5 }
(from Darrah Chavey)
and has generating function
(x^2+x+1)*(x^4+3*x^3+3*x+1)/((x^4+x^3+x^2+x+1)*(x-1)^2)
All the above conjectures are true - for proof see link to my article with Chaim Goodman-Strauss. - N. J. A. Sloane, Jan 14 2018; link added Mar 26 2018
a(n) ~ 24*n/5. - Stefano Spezia, May 08 2022
For n>0, a(n) = 2*(12*n + sqrt(1+2/sqrt(5))*sin(4*Pi*n/5) - sqrt(1-2/sqrt(5))*sin(2*Pi*n/5))/5. - Natalia L. Skirrow, Apr 13 2025

Extensions

a(6)-a(10) from Bradley Klee, Nov 23 2014
a(11)-a(49) from Maurizio Paolini, Nov 23 2014

A000002 Kolakoski sequence: a(n) is length of n-th run; a(1) = 1; sequence consists just of 1's and 2's.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Historical note: the sequence might be better called the Oldenburger-Kolakoski sequence, since it was discussed by Rufus Oldenburger in 1939; see links. - Clark Kimberling, Dec 06 2012. However, to avoid confusion, this sequence will be known in the OEIS as the Kolakoski sequence. It is undesirable to have some entries refer to the Oldenburger-Kolakoski sequence and others to the Kolakoski sequence. - N. J. A. Sloane, Nov 22 2017
It is an unsolved problem to show that the density of 1's is equal to 1/2.
A weaker problem is to construct a combinatorial bijection between the set of positions of 1's and the set of positions of 2's. - Gus Wiseman, Mar 01 2016
The sequence is cubefree and all square subwords have lengths which are one of 2, 4, 6, 18 and 54 (see A294447) [Carpi, 1994].
This is a fractal sequence: replace each run with its length and recover the original sequence. - Kerry Mitchell, Dec 08 2005
Kupin and Rowland write: We use a method of Goulden and Jackson to bound freq_1(K), the limiting frequency of 1 in the Kolakoski word K. We prove that |freq_1(K) - 1/2| <= 17/762, assuming the limit exists and establish the semirigorous bound |freq_1(K) - 1/2| <= 1/46. - Jonathan Vos Post, Sep 16 2008
freq_1(K) is conjectured to be 1/2 + O(log(K)) (see PlanetMath link). - Jon Perry, Oct 29 2014
Conjecture: Taking the sequence in word lengths of 10, for example, batch 1-10, 11-20, etc., then there can only be 4, 5 or 6 1's in each batch. - Jon Perry, Sep 26 2012
From Jean-Christophe Hervé, Oct 04 2014: (Start)
The sequence does not contain words of the form ababa, because this would imply the impossible 111 (1 b, 1 a, 1 b) somewhere before. This demonstrates the conjecture made by Jon Perry: more than 6 1's or 6 2's in a word of 10 would necessitate something like aabaabaaba, which would imply the impossible 12121 before (word aabaababaa is also impossible because of ababa). The remark on the sextuplets below even shows that the number of 1's in any 9-tuplet is always 4 or 5.
There are only 6 triples that appear in the sequence (112, 121, 122, 211, 212 and 221); and by the preceding argument, only 18 sextuplets: the 6 double triples (112112, etc.); 112122, 112212, 121122, 121221, 211212, and 211221; and those obtained by reversing the order of the triples (122112, etc.). Regarding the density of 1's in the sequence, these 12 sextuplets all have a density 1/2 of 1's, and the 6 double triples all lead to a word with this exact density after transformation by the Kolakoski rules, for example: 112112 -> 12112122 (4 1's/8); this is because the second triple reverses the numbers of 1's and 2's generated by the first triple. Therefore, the sequence can be split into the double triples on one side, a part whose transformation (which is in the sequence) has a density of 1's of 1/2; and a part with the other sextuplets, which has directly the same density of 1's. (End)
If we map 1 to +1 and 2 to -1, then the mapped sequence would have a [conjectured] mean of 0, since the Kolakoski sequence is [conjectured] to have an equal density (1/2) of 1s and 2s. For the partial sums of this mapped sequence, see A088568. - Daniel Forgues, Jul 08 2015
Looking at the plot for A088568, it seems that although the asymptotic densities of 1s and 2s appear to be 1/2, there might be a bias in favor of the 2s. I.e., D(1) = 1/2 - O(log(n)/n), D(2) = 1/2 + O(log(n)/n). - Daniel Forgues, Jul 11 2015
From Michel Dekking, Jan 31 2018: (Start)
(a(n)) is the unique fixed point of the 2-block substitution beta
11 -> 12
12 -> 122
21 -> 112
22 -> 1122.
A 2-block substitution beta maps a word w(1)...w(2n) to the word
beta(w(1)w(2))...beta(w(2n-1)w(2n)).
If the word has odd length, then the last letter is ignored.
It was noted by me in 1979 in the Bordeaux seminar on number theory that (a(n+1)) is fixed point of the 2-block substitution 11 -> 21, 12 -> 211, 21 -> 221, 22 -> 2211. (End)
Named after the American artist and recreational mathematician William George Kolakoski (1944-1997). - Amiram Eldar, Jun 17 2021

Examples

			Start with a(1) = 1. By definition of the sequence, this says that the first run has length 1, so it must be a single 1, and a(2) = 2. Thus, the second run (which starts with this 2) must have length 2, so the third term must be also be a(3) = 2, and the fourth term can't be a 2, so must be a(4) = 1. Since a(3) = 2, the third run must have length 2, so we deduce a(5) = 1, a(6) = 2, and so on. The correction I made was to change a(4) to a(5) and a(5) to a(6). - _Labos Elemer_, corrected by _Graeme McRae_
		

References

  • Jean-Paul Allouche and Jeffrey Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, p. 337.
  • Éric Angelini, "Jeux de suites", in Dossier Pour La Science, pp. 32-35, Volume 59 (Jeux math'), April/June 2008, Paris.
  • F. M. Dekking, What Is the Long Range Order in the Kolakoski Sequence?, in The mathematics of long-range aperiodic order (Waterloo, ON, 1995), 115-125, NATO Adv. Sci. Inst. Ser. C Math. Phys. Sci., 489, Kluwer Acad. Publ., Dordrecht, 1997. Math. Rev. 98g:11022.
  • Michael S. Keane, Ergodic theory and subshifts of finite type, Chap. 2 of T. Bedford et al., eds., Ergodic Theory, Symbolic Dynamics and Hyperbolic Spaces, Oxford, 1991, esp. p. 50.
  • J. C. Lagarias, Number Theory and Dynamical Systems, pp. 35-72 of S. A. Burr, ed., The Unreasonable Effectiveness of Number Theory, Proc. Sympos. Appl. Math., 46 (1992). Amer. Math. Soc.
  • 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, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • Ilan Vardi, Computational Recreations in Mathematica. Addison-Wesley, Redwood City, CA, 1991, p. 233.

Crossrefs

Cf. A054354, bisections: A100428, A100429.
Cf. A013947, A156077, A234322 (positions, running total and percentage of 1's).
Cf. A118270.
Cf. A049705, A088569 (are either subsequences of A000002? - Jon Perry, Oct 30 2014)
Kolakoski-type sequences using other seeds than (1,2):
A078880 (2,1), A064353 (1,3), A071820 (2,3), A074804 (3,2), A071907 (1,4), A071928 (2,4), A071942 (3,4), A074803 (4,2), A079729 (1,2,3), A079730 (1,2,3,4).
Other self-describing: A001462 (Golomb sequence, see also references therein), A005041, A100144.
Cf. A088568 (partial sums of [3 - 2 * a(n)]).

Programs

  • Haskell
    a = 1:2: drop 2 (concat . zipWith replicate a . cycle $ [1,2]) -- John Tromp, Apr 09 2011
    
  • Maple
    M := 100; s := [ 1,2,2 ]; for n from 3 to M do for i from 1 to s[ n ] do s := [ op(s),1+((n-1)mod 2) ]; od: od: s; A000002 := n->s[n];
    # alternative implementation based on the Cloitre formula:
    A000002 := proc(n)
        local ksu,k ;
        option remember;
        if n = 1 then
            1;
        elif n <=3 then
            2;
        else
            for k from 1 do
                ksu := add(procname(i),i=1..k) ;
                if n = ksu then
                    return (3+(-1)^k)/2 ;
                elif n = ksu+ 1 then
                    return (3-(-1)^k)/2 ;
                end if;
            end do:
        end if;
    end proc: # R. J. Mathar, Nov 15 2014
  • Mathematica
    a[steps_] := Module[{a = {1, 2, 2}}, Do[a = Append[a, 1 + Mod[(n - 1), 2]], {n, 3, steps}, {i, a[[n]]}]; a]
    a[ n_] := If[ n < 3, Max[ 0, n], Module[ {an = {1, 2, 2}, m = 3}, While[ Length[ an] < n, an = Join[ an, Table[ Mod[m, 2, 1], { an[[ m]]} ]]; m++]; an[[n]]]] (* Michael Somos, Jul 11 2011 *)
    n=8; Prepend[ Nest[ Flatten[ Partition[#, 2] /. {{2, 2} -> {2, 2, 1, 1}, {2, 1} -> {2, 2, 1}, {1, 2} -> {2, 1, 1}, {1, 1} -> {2, 1}}] &, {2, 2}, n], 1] (* Birkas Gyorgy, Jul 10 2012 *)
    KolakoskiSeq[n_Integer] := Block[{a = {1, 2, 2}}, Fold[Join[#1, ConstantArray[Mod[#2, 2, 1], #1[[#2]]]] &, a, Range[3, n]]]; KolakoskiSeq[999] (* Mikk Heidemaa, Nov 01 2024 *) (* Corrected by Giorgos Kalogeropoulos, May 09 2025 *)
  • PARI
    my(a=[1,2,2]); for(n=3,80, for(i=1,a[n],a=concat(a,2-n%2))); a
    
  • PARI
    {a(n) = local(an=[1, 2, 2], m=3); if( n<1, 0, while( #an < n, an = concat( an, vector(an[m], i, 2-m%2)); m++); an[n])};
    
  • Python
    # For explanation see link.
    def Kolakoski():
        x = y = -1
        while True:
            yield [2,1][x&1]
            f = y &~ (y+1)
            x ^= f
            y = (y+1) | (f & (x>>1))
    K = Kolakoski()
    print([next(K) for  in range(100)]) # _David Eppstein, Oct 15 2016

Formula

These two formulas define completely the sequence: a(1)=1, a(2)=2, a(a(1) + a(2) + ... + a(k)) = (3 + (-1)^k)/2 and a(a(1) + a(2) + ... + a(k) + 1) = (3 - (-1)^k)/2. - Benoit Cloitre, Oct 06 2003
a(n+2)*a(n+1)*a(n)/2 = a(n+2) + a(n+1) + a(n) - 3 (this formula doesn't define the sequence, it is just a consequence of the definition). - Benoit Cloitre, Nov 17 2003
a(n+1) = 3 - a(n) + (a(n) - a(n-1))*(a(b(n)) - 1), where b(n) is the sequence A156253. - Jean-Marc Fedou and Gabriele Fici, Mar 18 2010
a(n) = (3 + (-1)^A156253(n))/2. - Benoit Cloitre, Sep 17 2013
Conjectures from Boštjan Gec, Oct 07 2024: (Start)
a(n)*(a(n-1) + a(n-2) - 3) + a(n-1)*a(n-2) + 7 = 3*a(n-1) + 3*a(n-2).
a(n)*(a(n-1) + a(n-2) - 3) = a(n-3)*(a(n-1) + a(n-2) - 3). (End)
Comment from Kevin Ryde, Oct 07 2024: The above formulas are true: The parts identify when terms are same or different and they hold for any sequence of 1's and 2's with run lengths 1 or 2.

Extensions

Minor edits to example and PARI code made by M. F. Hasler, May 07 2014

A001462 Golomb's sequence: a(n) is the number of times n occurs, starting with a(1) = 1.

Original entry on oeis.org

1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 19
Offset: 1

Views

Author

Keywords

Comments

It is understood that a(n) is taken to be the smallest number >= a(n-1) which is compatible with the description.
In other words, this is the lexicographically earliest nondecreasing sequence of positive numbers which is equal to its RUNS transform. - N. J. A. Sloane, Nov 07 2018
Also called Silverman's sequence.
Vardi gives several identities satisfied by A001463 and this sequence.
We can interpret this sequence as a triangle: start with 1; 2,2; 3,3; and proceed by letting the row sum of row m-1 be the number of elements of row m. The partial sums of the row sums give 1, 5, 11, 38, 272, ... Conjecture: this proceeds as Lionel Levine's sequence A014644. See also A113676. - Floor van Lamoen, Nov 06 2005
A Golomb-type sequence, that is, one with the property of being a sequence of run length of itself, can be built over any sequence with distinct terms by repeating each term a corresponding number of times, in the same manner as a(n) is built over natural numbers. See cross-references for more examples. - Ivan Neretin, Mar 29 2015
From Amiram Eldar, Jun 19 2021: (Start)
Named after the American mathematician Solomon Wolf Golomb (1932-2016).
Guy (2004) called it "Golomb's self-histogramming sequence", while in previous editions of his book (1981 and 1994) he called it "Silverman's sequence" after David Silverman. (End)
a(n) is also the number of numbers that occur n times. - Leo Crabbe, Feb 15 2025

Examples

			a(1) = 1, so 1 only appears once. The next term is therefore 2, which means 2 appears twice and so a(3) is also 2 but a(4) must be 3. And so on.
G.f. = x + 2*x^2 + 2*x^3 + 3*x^4 + 3*x^5 + 4*x^6 + 4*x^7 + 4*x^8 + ... - _Michael Somos_, Nov 07 2018
		

References

  • Graham Everest, Alf van der Poorten, Igor Shparlinski and Thomas Ward, Recurrence Sequences, Amer. Math. Soc., 2003; p. 10.
  • Ronald L. Graham, Donald E. Knuth and Oren Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 1990, p. 66.
  • Richard K. Guy, Unsolved Problems in Number Theory, 3rd Edition, Springer, 2004, Section E25, p. 347-348.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane, Seven Staggering Sequences, in Homage to a Pied Puzzler, E. Pegg Jr., A. H. Schoen and T. Rodgers (editors), A. K. Peters, Wellesley, MA, 2009, pp. 93-110.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A001463 (partial sums) and A262986 (start of first run of length n).
First differences are A088517.
Golomb-type sequences over various substrates (from Glen Whitney, Oct 12 2015):
A000002 and references therein (over periodic sequences),
A109167 (over nonnegative integers),
A080605 (over odd numbers),
A080606 (over even numbers),
A080607 (over multiples of 3),
A169682 (over primes),
A013189 (over squares),
A013322 (over triangular numbers),
A250983 (over integral sums of itself).
Applying "ee Rabot" to this sequence gives A319434.
See also A095114.

Programs

  • Haskell
    a001462 n = a001462_list !! (n-1)
    a001462_list = 1 : 2 : 2 : g 3  where
       g x = (replicate (a001462 x) x) ++ g (x + 1)
    -- Reinhard Zumkeller, Feb 09 2012
    
  • Magma
    [ n eq 1 select 1 else 1+Self(n-Self(Self(n-1))) : n in [1..100] ]; // Sergei Haller (sergei(AT)sergei-haller.de), Dec 21 2006
    
  • Maple
    N:= 10000: A001462[1]:= 1: B[1]:= 1: A001462[2]:= 2:
    for n from 2 while B[n-1] <= N do
      B[n]:= B[n-1] + A001462[n];
      for j from B[n-1]+1 to B[n] do A001462[j]:= n end do
    end do:
    seq(A001462[j],j=1..N); # Robert Israel, Oct 30 2012
  • Mathematica
    a[1] = 1; a[n_] := a[n] = 1 + a[n - a[a[n - 1]]]; Table[ a[n], {n, 84}] (* Robert G. Wilson v, Aug 26 2005 *)
    GolSeq[n_]:=Nest[(k = 0; Flatten[# /. m_Integer :> (ConstantArray[++k,m])]) &, {1, 2}, n]
    GolList=Nest[(k = 0;Flatten[# /.m_Integer :> (ConstantArray[++k,m])]) &, {1, 2},7]; AGolList=Accumulate[GolList]; Golomb[n_]:=Which[ n <= Length[GolList], GolList[[n]], n <= Total[GolList],First[FirstPosition[AGolList, ?(# > n &)]], True, $Failed] (* _JungHwan Min, Nov 29 2015 *)
  • PARI
    a = [1, 2, 2]; for(n=3, 20, for(i=1, a[n], a = concat(a, n))); a /* Michael Somos, Jul 16 1999 */
    
  • PARI
    {a(n) = my(A, t, i); if( n<3, max(0, n), A = vector(n); t = A[i=2] = 2; for(k=3, n, A[k] = A[k-1] + if( t--==0, t = A[i++]; 1)); A[n])}; /* Michael Somos, Oct 21 2006 */
    
  • Python
    a=[0, 1, 2, 2]
    for n in range(3, 21):a+=[n for i in range(1, a[n] + 1)]
    a[1:] # Indranil Ghosh, Jul 05 2017

Formula

a(n) = phi^(2-phi)*n^(phi-1) + E(n), where phi is the golden number (1+sqrt(5))/2 (Marcus and Fine) and E(n) is an error term which Vardi shows is O( n^(phi-1) / log n ).
a(1) = 1; a(n+1) = 1 + a(n+1-a(a(n))). - Colin Mallows
a(1)=1, a(2)=2 and for a(1) + a(2) + ... + a(n-1) < k <= a(1) + a(2) + ... + a(n) we have a(k)=n. - Benoit Cloitre, Oct 07 2003
G.f.: Sum_{n>0} a(n) x^n = Sum_{k>0} x^a(k). - Michael Somos, Oct 21 2006
a(A095114(n)) = n and a(m) < n for m < A095114(n). - Reinhard Zumkeller, Feb 09 2012 [First inequality corrected from a(m) < m by Glen Whitney, Oct 06 2015]
Conjecture: a(n) >= n^(phi-1) for all n. - Jianing Song, Aug 19 2021
a(n) = A095114(n+1) - A095114(n). - Alan Michael Gómez Calderón, Dec 21 2024 after Ralf Stephan

A008574 a(0) = 1, thereafter a(n) = 4n.

Original entry on oeis.org

1, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80, 84, 88, 92, 96, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144, 148, 152, 156, 160, 164, 168, 172, 176, 180, 184, 188, 192, 196, 200, 204, 208, 212, 216, 220, 224, 228, 232
Offset: 0

Views

Author

N. J. A. Sloane; entry revised Aug 24 2014

Keywords

Comments

Number of squares on the perimeter of an (n+1) X (n+1) board. - Jon Perry, Jul 27 2003
Coordination sequence for square lattice (or equivalently the planar net 4.4.4.4).
Apparently also the coordination sequence for the planar net 3.4.6.4. - Darrah Chavey, Nov 23 2014
From N. J. A. Sloane, Nov 26 2014: (Start)
I confirm that this is indeed the coordination sequence for the planar net 3.4.6.4. The points at graph distance n from a fixed point in this net essentially lie on a hexagon (see illustration in link).
If n = 3k, k >= 1, there are 2k + 1 nodes on each edge of the hexagon. This counts the corners of the hexagon twice, so the number of points in the shell is 6(2k + 1) - 6 = 4n. If n = 3k + 1, the numbers of points on the six edges of the hexagon are 2k + 2 (4 times) and 2k + 1 (twice), for a total of 12k + 10 - 6 = 4n. If n = 3k + 2 the numbers are 2k + 2 (4 times) and 2k + 3 twice, and again we get 4n points.
The illustration shows shells 0 through 12, as well as the hexagons formed by shells 9 (green, 36 points), 10 (black, 40 points), 11 (red, 44 points), and 12 (blue, 48 points).
It is clear from the net that this period-3 structure continues forever, and establishes the theorem.
In contrast, for the 4.4.4.4 planar net, the successive shells are diamonds instead of hexagons, and again the n-th shell (n > 0) contains 4n points.
Of course the two nets are very different, since 4.4.4.4 has the symmetry of the square, while 3.4.6.4 has only mirror symmetry (with respect to a point), and has the symmetry of a regular hexagon with respect to the center of any of the 12-gons. (End)
Also the coordination sequence for a 6.6.6.6 point in the 3-transitive tiling {4.6.6, 6.6.6, 6.6.6.6}, see A265045, A265046. - N. J. A. Sloane, Dec 27 2015
Also the coordination sequence for 2-dimensional cyclotomic lattice Z[zeta_4].
Susceptibility series H_1 for 2-dimensional Ising model (divided by 2).
Also the Engel expansion of exp^(1/4); cf. A006784 for the Engel expansion definition. - Benoit Cloitre, Mar 03 2002
This sequence differs from A008586, multiples of 4, only in its initial term. - Alonso del Arte, Apr 14 2011
Number of 2 X n binary matrices avoiding simultaneously the right angled numbered polyomino patterns (ranpp) (00,0), (00;1) and (10;1). An occurrence of a ranpp (xy;z) in a matrix A=(a(i,j)) is a triple (a(i1,j1), a(i1,j2), a(i2,j1)) where i1 < i2 and j1 < j2 and these elements are in same relative order as those in the triple (x,y,z). - Sergey Kitaev, Nov 11 2004
Central terms of the triangle in A118013. - Reinhard Zumkeller, Apr 10 2006
Also the coordination sequence for the htb net. - N. J. A. Sloane, Mar 31 2018
This is almost certainly also the coordination sequence for Dual(3.3.4.3.4) with respect to a tetravalent node. - Tom Karzes, Apr 01 2020
Minimal number of segments (equivalently, corners) in a rook circuit of a 2n X 2n board (maximal number is A085622). - Ruediger Jehn, Jan 02 2021

Examples

			From _Omar E. Pol_, Aug 20 2011 (Start):
Illustration of initial terms as perimeters of squares (cf. Perry's comment above):
.                                         o o o o o o
.                             o o o o o   o         o
.                   o o o o   o       o   o         o
.           o o o   o     o   o       o   o         o
.     o o   o   o   o     o   o       o   o         o
. o   o o   o o o   o o o o   o o o o o   o o o o o o
.
. 1    4      8        12         16           20
(End)
		

Crossrefs

Cf. A001844 (partial sums), A008586, A054275, A054410, A054389, A054764.
Convolution square of A040000.
Row sums of A130323 and A131032.
List of coordination sequences for uniform planar nets: A008458 (the planar net 3.3.3.3.3.3), A008486 (6^3), A008574 (4.4.4.4 and 3.4.6.4), A008576 (4.8.8), A008579(3.6.3.6), A008706 (3.3.3.4.4), A072154 (4.6.12), A219529(3.3.4.3.4), A250120 (3.3.3.3.6), A250122 (3.12.12).
List of coordination sequences for Laves tilings (or duals of uniform planar nets): [3,3,3,3,3.3] = A008486; [3.3.3.3.6] = A298014, A298015, A298016; [3.3.3.4.4] = A298022, A298024; [3.3.4.3.4] = A008574, A296368; [3.6.3.6] = A298026, A298028; [3.4.6.4] = A298029, A298031, A298033; [3.12.12] = A019557, A298035; [4.4.4.4] = A008574; [4.6.12] = A298036, A298038, A298040; [4.8.8] = A022144, A234275; [6.6.6] = A008458.
Coordination sequences for the 20 2-uniform tilings in the order in which they appear in the Galebach catalog, together with their names in the RCSR database (two sequences per tiling): #1 krt A265035, A265036; #2 cph A301287, A301289; #3 krm A301291, A301293; #4 krl A301298, A298024; #5 krq A301299, A301301; #6 krs A301674, A301676; #7 krr A301670, A301672; #8 krk A301291, A301293; #9 krn A301678, A301680; #10 krg A301682, A301684; #11 bew A008574, A296910; #12 krh A301686, A301688; #13 krf A301690, A301692; #14 krd A301694, A219529; #15 krc A301708, A301710; #16 usm A301712, A301714; #17 krj A219529, A301697; #18 kre A301716, A301718; #19 krb A301720, A301722; #20 kra A301724, A301726.
See also A265045, A265046.

Programs

  • Haskell
    a008574 0 = 1; a008574 n = 4 * n
    a008574_list = 1 : [4, 8 ..]  -- Reinhard Zumkeller, Apr 16 2015
  • Mathematica
    f[0] = 1; f[n_] := 4 n; Array[f, 59, 0] (* or *)
    CoefficientList[ Series[(1 + x)^2/(1 - x)^2, {x, 0, 58}], x] (* Robert G. Wilson v, Jan 02 2011 *)
    Join[{1},Range[4,232,4]] (* Harvey P. Dale, Aug 19 2011 *)
    a[ n_] := 4 n + Boole[n == 0]; (* Michael Somos, Jan 07 2019 *)
  • PARI
    {a(n) = 4*n + !n}; /* Michael Somos, Apr 16 2007 */
    

Formula

Binomial transform is A000337 (dropping the 0 there). - Paul Barry, Jul 21 2003
Euler transform of length 2 sequence [4, -2]. - Michael Somos, Apr 16 2007
G.f.: ((1 + x) / (1 - x))^2. E.g.f.: 1 + 4*x*exp(x). - Michael Somos, Apr 16 2007
a(-n) = -a(n) unless n = 0. - Michael Somos, Apr 16 2007
G.f.: exp(4*atanh(x)). - Jaume Oliver Lafont, Oct 20 2009
a(n) = a(n-1) + 4, n > 1. - Vincenzo Librandi, Dec 31 2010
a(n) = A005408(n-1) + A005408(n), n > 1. - Ivan N. Ianakiev, Jul 16 2012
a(n) = 4*n = A008586(n), n >= 1. - Tom Karzes, Apr 01 2020

A219529 Coordination sequence for 3.3.4.3.4 Archimedean tiling.

Original entry on oeis.org

1, 5, 11, 16, 21, 27, 32, 37, 43, 48, 53, 59, 64, 69, 75, 80, 85, 91, 96, 101, 107, 112, 117, 123, 128, 133, 139, 144, 149, 155, 160, 165, 171, 176, 181, 187, 192, 197, 203, 208, 213, 219, 224, 229, 235, 240, 245, 251, 256, 261, 267, 272, 277, 283, 288, 293, 299
Offset: 0

Views

Author

Allan C. Wechsler, Nov 21 2012

Keywords

Comments

a(n) is the number of vertices of the 3.3.4.3.4 tiling (which has three triangles and two squares, in the given cyclic order, meeting at each vertex) whose shortest path connecting them to a given origin vertex contains n edges.
This is the dual tiling to the Cairo tiling (cf. A296368). - N. J. A. Sloane, Nov 02 2018
First few terms provided by Allan C. Wechsler; Fred Lunnon and Fred Helenius gave the next few; Fred Lunnon suggested that the recurrence was a(n+3) = a(n) + 16 for n > 1. [This conjecture is true - see the CGS-NJAS link for a proof. - N. J. A. Sloane, Dec 31 2017]
Appears also to be coordination sequence for node of type V2 in "krd" 2-D tiling (or net). This should be easy to prove by the coloring book method (see link). - N. J. A. Sloane, Mar 25 2018
Appears also to be coordination sequence for node of type V1 in "krj" 2-D tiling (or net). This also should be easy to prove by the coloring book method (see link). - N. J. A. Sloane, Mar 26 2018
First differences of A301696. - Klaus Purath, May 23 2020

References

  • Branko Grünbaum and G. C. Shephard, Tilings and Patterns. W. H. Freeman, New York, 1987. See Table 2.2.1, page 67, 1st row, 2nd tiling, also 2nd row, third tiling.

Crossrefs

List of coordination sequences for uniform planar nets: A008458 (the planar net 3.3.3.3.3.3), A008486 (6^3), A008574 (4.4.4.4 and 3.4.6.4), A008576 (4.8.8), A008579 (3.6.3.6), A008706 (3.3.3.4.4), A072154 (4.6.12), A219529 (3.3.4.3.4), A250120 (3.3.3.3.6), A250122 (3.12.12).
Coordination sequences for the 20 2-uniform tilings in the order in which they appear in the Galebach catalog, together with their names in the RCSR database (two sequences per tiling): #1 krt A265035, A265036; #2 cph A301287, A301289; #3 krm A301291, A301293; #4 krl A301298, A298024; #5 krq A301299, A301301; #6 krs A301674, A301676; #7 krr A301670, A301672; #8 krk A301291, A301293; #9 krn A301678, A301680; #10 krg A301682, A301684; #11 bew A008574, A296910; #12 krh A301686, A301688; #13 krf A301690, A301692; #14 krd A301694, A219529; #15 krc A301708, A301710; #16 usm A301712, A301714; #17 krj A219529, A301697; #18 kre A301716, A301718; #19 krb A301720, A301722; #20 kra A301724, A301726.

Programs

  • Haskell
    -- Very slow, could certainly be accelerated.  SST stands for Snub Square Tiling.
    setUnion [] l2 = l2
    setUnion (a:rst) l2 = if (elem a l2) then doRest else (a:doRest)
      where doRest = setUnion rst l2
    setDifference [] l2 = []
    setDifference (a:rst) l2 = if (elem a l2) then doRest else (a:doRest)
      where doRest = setDifference rst l2
    adjust k = (if (even k) then 1 else -1)
    weirdAdjacent (x,y) = (x+(adjust y),y+(adjust x))
    sstAdjacents (x,y) = [(x+1,y),(x-1,y),(x,y+1),(x,y-1),(weirdAdjacent (x,y))]
    sstNeighbors core = foldl setUnion core (map sstAdjacents core)
    sstGlob n core = if (n == 0) then core else (sstGlob (n-1) (sstNeighbors core))
    sstHalo core = setDifference (sstNeighbors core) core
    origin = [(0,0)]
    a219529 n = length (sstHalo (sstGlob (n-1) origin))
    -- Allan C. Wechsler, Nov 30 2012
    
  • Maple
    A219529:= n -> `if`(n=0, 1, (16*n +1 - `mod`(n+1,3))/3);
    seq(A219529(n), n = 0..60); # G. C. Greubel, May 27 2020
  • Mathematica
    Join[{1}, LinearRecurrence[{1,0,1,-1}, {5,11,16,21}, 60]] (* Jean-François Alcover, Dec 13 2018 *)
    Table[If[n==0, 1, (16*n +1 - Mod[n+1, 3])/3], {n, 0, 60}] (* G. C. Greubel, May 27 2020 *)
    CoefficientList[Series[(x+1)^4/((x^2+x+1)(x-1)^2),{x,0,70}],x] (* Harvey P. Dale, Jul 03 2021 *)
  • Sage
    [1]+[(16*n+1 -(n+1)%3)/3 for n in (1..60)] # G. C. Greubel, May 27 2020

Formula

Conjectured to be a(n) = floor((16n+1)/3) for n>0; a(0) = 1; this is a consequence of the suggested recurrence due to Lunnon (see comments). [This conjecture is true - see the CGS-NJAS link in A296368 for a proof. - N. J. A. Sloane, Dec 31 2017]
G.f.: (x+1)^4/((x^2+x+1)*(x-1)^2). - N. J. A. Sloane, Feb 07 2018
From G. C. Greubel, May 27 2020: (Start)
a(n) = (16*n - ChebyshevU(n-1, -1/2))/3 for n>0 with a(0)=1.
a(n) = (A008598(n) - A049347(n-1))/3 for n >0 with a(0)=1. (End)

Extensions

Corrected attributions and epistemological status in Comments; provided slow Haskell code - Allan C. Wechsler, Nov 30 2012
Extended by Joseph Myers, Dec 04 2014

A318921 In binary expansion of n, delete one symbol from each run. Set a(n)=0 if the result is the empty string.

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 1, 3, 0, 0, 0, 1, 2, 1, 3, 7, 0, 0, 0, 1, 0, 0, 1, 3, 4, 2, 1, 3, 6, 3, 7, 15, 0, 0, 0, 1, 0, 0, 1, 3, 0, 0, 0, 1, 2, 1, 3, 7, 8, 4, 2, 5, 2, 1, 3, 7, 12, 6, 3, 7, 14, 7, 15, 31, 0, 0, 0, 1, 0, 0, 1, 3, 0, 0, 0, 1, 2, 1, 3, 7, 0, 0, 0, 1, 0, 0, 1, 3, 4, 2, 1, 3, 6, 3, 7, 15, 16
Offset: 0

Views

Author

N. J. A. Sloane, Sep 08 2018

Keywords

Comments

If the binary expansion of n is 1^b 0^c 1^d 0^e ..., then a(n) is the number whose binary expansion is 1^(b-1) 0^(c-1) 1^(d-1) 0^(e-1) .... Leading 0's are omitted, and if the result is the empty string, here we set a(n) = 0. See A319419 for a version which represents the empty string by -1.
Lenormand refers to this operation as planing ("raboter") the runs (or blocks) of the binary expansion.
A175046 expands the runs in a similar way, and a(A175046(n)) = A001477(n). - Andrew Weimholt, Sep 08 2018. In other words, this is a left inverse to A175046: A318921 o A175046 = A001477 = id on [0..oo). - M. F. Hasler, Sep 10 2018
Conjecture: For n in the range 2^k, ..., 2^(k+1)-1, the total value of a(n) appears to be 2*3^(k-1) - 2^(k-1) (see A027649), and so the average value of a(n) appears to be (3/2)^(k-1) - 1/2. - N. J. A. Sloane, Sep 25 2018
The above conjecture was proved by Doron Zeilberger on Nov 16 2018 (see link) and independently by Chai Wah Wu on Nov 18 2018 (see below). - N. J. A. Sloane, Nov 20 2018
From Chai Wah Wu, Nov 18 2018: (Start)
Conjecture is correct for k > 0. Proof: looking at the least significant 2 bits of n, it is easy to see that a(4n) = 2a(2n), a(4n+1) = a(2n), a(4n+2) = a(2n+1) and a(4n+3) = 2a(2n+1)+1. Define f(k) = Sum_{i=2^k..2^(k+1)-1} a(i), i.e. the sum ranges over all numbers with a (k+1)-bit binary expansion. Thus f(0) = a(1) = 0 and f(1) = a(2)+a(3) = 1. By summing over the recurrence relations for a(n), we get f(k+2) = Sum_{i=2^k..2^(k+1)-1} (f(4i) + f(4i+1) + f(4i+2) + f(4i+3)) = Sum_{i=2^k..2^(k+1)-1} (3a(2i) + 3a(2i+1) + 1) = 3*f(k+1) + 2^k. Solving this first order recurrence relation with the initial condition f(1) = 1 shows that f(k) = 2*3^(k-1)-2^(k-1) for k > 0.
(End)

Examples

			      n / "planed" string / a(n)
      0   e 0 (e = empty string)
      1   e 0
     10   e 0
     11   1 1
    100   0 0
    101   e 0
    110   1 1
    111  11 3
   1000  00 0
   1001   0 0
   1010   e 0
   1011   1 1
   1100  10 2
   1101   1 1
   1110  11 3
   1111 111 7
  10000 000 0
  ...
		

Crossrefs

Cf. A027649 (average value), A175046, A319419 (a version where a(n)=-1 if the result is the empty string).
See also A319416.

Programs

  • Maple
    r:=proc(n) local t1,t2,L1,len,i,j,k,b1;
    if n <= 2 then return(0); fi;
    b1:=[]; t1:=convert(n,base,2); L1:=nops(t1); p:=1; len:=1;
    for i from 2 to L1 do
    t2:=t1[L1+1-i];
    if (t2=p) and (i1 then for j from 1 to len-1 do b1:=[op(b1),p]; od: fi;
       p:=t2; len:=1;
    fi;               od;
    if nops(b1)=0 then return(0);
    else k:=b1[1];
    for i from 2 to nops(b1) do k:=2*k+b1[i]; od;
    return(k);
    fi;
    end;
    [seq(r(n),n=0..120)];
  • Mathematica
    a[n_] := FromDigits[Flatten[Rest /@ Split[IntegerDigits[n, 2]]], 2];
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Sep 10 2018 *)
  • PARI
    a(n) = if (n==0, 0, n%2==0, my (z=valuation(n,2)); a(n/2^z) * 2^(z-1), my (o=valuation(n+1,2)); (a(n\2^o)+1) * 2^(o-1)-1) \\ Rémy Sigrist, Sep 09 2018
    
  • PARI
    a(n)={forstep(i=#n=binary(n+!n),2,-1,n[i-1]!=n[i] && n=n[^i]); fromdigits(n[^1],2)} \\ For illustration purpose. - M. F. Hasler, Sep 10 2018
    
  • PARI
    A318921(n)=if(n<3, 0, bittest(n, 0), (A318921(n>>n=valuation(n+1, 2))+1)<<(n-1)-1, A318921(n>>n=valuation(n, 2))<<(n-1)) \\ M. F. Hasler, Sep 11 2018
    
  • Python
    from itertools import groupby
    def a(n):
        s = "".join(k*(len(list(g))-1) for k, g in groupby(bin(n)[2:]))
        return int(s, 2) if s != "" else 0
    print([a(n) for n in range(82)]) # Michael S. Branicky, Jun 01 2025

Formula

a(4n) = 2a(2n), a(4n+1) = a(2n), a(4n+2) = a(2n+1) and a(4n+3) = 2a(2n+1)+1. - Chai Wah Wu, Nov 18 2018

A265035 Coordination sequence of 2-uniform tiling {3.4.6.4, 4.6.12} with respect to a point of type 4.6.12.

Original entry on oeis.org

1, 3, 6, 9, 11, 14, 17, 21, 25, 28, 30, 32, 35, 39, 43, 46, 48, 50, 53, 57, 61, 64, 66, 68, 71, 75, 79, 82, 84, 86, 89, 93, 97, 100, 102, 104, 107, 111, 115, 118, 120, 122, 125, 129, 133, 136, 138, 140, 143, 147, 151, 154, 156, 158, 161, 165, 169, 172, 174, 176
Offset: 0

Views

Author

N. J. A. Sloane, Dec 12 2015

Keywords

Comments

Joseph Myers (Dec 14 2015) reports that "My program for coordination sequences requires describing the tiling structure under translation, listing all edges in the form: (class1, 0, 0) has an edge to (class2, x, y). The present tiling has 18 orbits of vertices under translation and 30 orbits of edges under translation (each of which is described in both directions). So in principle it could generate the other 19 2-uniform tilings, but without a cross check with hand-computed terms there's a risk of e.g. missing some edges, and a fair amount of work producing all the descriptions of translation classes of edges."
Linear recurrence and g.f. confirmed by Shutov/Maleev link. - Ray Chandler, Aug 31 2023

References

  • Branko Grünbaum and G. C. Shephard, Tilings and Patterns. W. H. Freeman, New York, 1987. See page 67, 4th row, 3rd tiling.
  • Otto Krötenheerdt, Die homogenen Mosaike n-ter Ordnung in der euklidischen Ebene, I, II, III, Wiss. Z. Martin-Luther-Univ. Halle-Wittenberg, Math-Natur. Reihe, 18 (1969), 273-290; 19 (1970), 19-38 and 97-122. [Includes classification of 2-uniform tilings]
  • Anton Shutov and Andrey Maleev, Coordination sequences of 2-uniform graphs, Z. Kristallogr., 235 (2020), 157-166.

Crossrefs

See A265036 for the other type of point.
List of coordination sequences for uniform planar nets: A008458 (the planar net 3.3.3.3.3.3), A008486 (6^3), A008574 (4.4.4.4 and 3.4.6.4), A008576 (4.8.8), A008579 (3.6.3.6), A008706(3.3.3.4.4), A072154 (4.6.12), A219529 (3.3.4.3.4), A250120(3.3.3.3.6), A250122 (3.12.12).
Coordination sequences for the 20 2-uniform tilings in the order in which they appear in the Galebach catalog, together with their names in the RCSR database (two sequences per tiling): #1 krt A265035, A265036; #2 cph A301287, A301289; #3 krm A301291, A301293; #4 krl A301298, A298024; #5 krq A301299, A301301; #6 krs A301674, A301676; #7 krr A301670, A301672; #8 krk A301291, A301293; #9 krn A301678, A301680; #10 krg A301682, A301684; #11 bew A008574, A296910; #12 krh A301686, A301688; #13 krf A301690, A301692; #14 krd A301694, A219529; #15 krc A301708, A301710; #16 usm A301712, A301714; #17 krj A219529, A301697; #18 kre A301716, A301718; #19 krb A301720, A301722; #20 kra A301724, A301726.

Programs

  • Mathematica
    LinearRecurrence[{3,-4,3,-1},{1,3,6,9,11,14,17,21,25},100] (* Paolo Xausa, Nov 15 2023 *)

Formula

Based on the b-file, the g.f. appears to be (1+x^2+2*x^5-2*x^6+2*x^7-x^8)/(1-3*x+4*x^2-3*x^3+x^4). This matches the first 1000 terms, so is probably correct. - N. J. A. Sloane, Dec 14 2015
Conjectured g.f. is equivalent to a(n) = 3*n - A010892(n+1) for n >= 5. - R. J. Mathar, Oct 09 2020

Extensions

Extended by Joseph Myers, Dec 13 2015
b-file extended by Joseph Myers, Dec 18 2015

A175046 Write n in binary, then increase each run of 0's by one 0, and increase each run of 1's by one 1. a(n) is the decimal equivalent of the result.

Original entry on oeis.org

3, 12, 7, 24, 51, 28, 15, 48, 99, 204, 103, 56, 115, 60, 31, 96, 195, 396, 199, 408, 819, 412, 207, 112, 227, 460, 231, 120, 243, 124, 63, 192, 387, 780, 391, 792, 1587, 796, 399, 816, 1635, 3276, 1639, 824, 1651, 828, 415, 224, 451, 908, 455, 920, 1843, 924
Offset: 1

Views

Author

Leroy Quet, Dec 02 2009

Keywords

Comments

A318921 expands the runs in a similar way, and A318921(a(n)) = A001477(n). - Andrew Weimholt, Sep 08 2018
From Chai Wah Wu, Nov 18 2018: (Start)
Let f(k) = Sum_{i=2^k..2^(k+1)-1} a(i), i.e., the sum ranges over all numbers with a (k+1)-bit binary expansion. Thus f(0) = a(1) = 3 and f(1) = a(2) + a(3) = 19.
Then f(k) = 20*6^(k-1) - 2^(k-1) for k > 0.
Proof: by summing over the recurrence relations for a(n) (see formula section), we get f(k+2) = Sum_{i=2^k..2^(k+1)-1} (f(4i) + f(4i+1) + f(4i+2) + f(4i+3)) = Sum_{i=2^k..2^(k+1)-1} (6*a(2i) + 6*a(2i+1) + 4) = 6*f(k+1) + 2^(k+2). Solving this first-order recurrence relation with the initial condition f(1) = 19 shows that f(k) = 20*6^(k-1)-2^(k-1) for k > 0.
(End)

Examples

			6 in binary is 110. Increase each run by one digit to get 11100, which is 28 in decimal. So a(6) = 28.
		

Crossrefs

Cf. A175047, A175048, A324127 (partial sums).
For records see A319422, A319423, A319424.

Programs

  • Haskell
    import Data.List (group)
    a175046 = foldr (\b v -> 2 * v + b) 0 .
              concatMap (\bs@(b:_) -> b : bs) . group . a030308_row
    -- Reinhard Zumkeller, Jul 05 2013
    
  • Mathematica
    a[n_] := (Append[#, #[[1]]]& /@ Split[IntegerDigits[n, 2]]) // Flatten // FromDigits[#, 2]&;
    Array[a, 60] (* Jean-François Alcover, Nov 12 2018 *)
  • PARI
    A175046(n)={for(i=2,#n=binary (n*2+bittest (n,0)),n[i]!=n[i-1]&&n[i-1]*=[1,1]);fromdigits(concat(n),2)} \\ M. F. Hasler, Sep 08 2018
    
  • Python
    from re import split
    def A175046(n):
        return int(''.join(d+'1' if '1' in d else d+'0' for d in split('(0+)|(1+)',bin(n)[2:]) if d != '' and d != None),2) # Chai Wah Wu, Sep 24 2018
    
  • Python
    def a(n):
        b = bin(n)[2:]
        return int(b.replace("01", "001").replace("10", "110") + b[-1], 2)
    print([a(n) for n in range(1, 55)]) # Michael S. Branicky, Dec 07 2021

Formula

2n+1 <= a(n) < 2*(n+1/n)^2; a(n) mod 4 = 3*(n mod 2). - M. F. Hasler, Sep 08 2018
a(n) <= (9*n^2 + 12*n)/5, with equality iff n = (2/3)*(4^k-1) = A182512(k) for some k, i.e., n = 10101...10 in binary. - Conjectured by N. J. A. Sloane, Sep 09 2018, proved by M. F. Hasler, Sep 12 2018
From M. F. Hasler, Sep 12 2018: (Start)
Proof of N. J. A. Sloane's formula: For given (binary) length L(n) = floor(log_2(n)+1), the length of a(n) is maximal, L(a(n)) = 2*L(n), if and only if n's bits are alternating, i.e., n in A020988 (if even) or in A002450 (if odd).
For n = A020988(k) (= k times '10' in base 2) = (4^k - 1)*2/3, one has a(n) = A108020(k) (= k times '1100' in base 2) = (16^k - 1)*4/5. This yields a(n)/n = (4^k + 1)*6/5 = (n*9 + 12)/5, i.e., the given upper bound.
For n = A002450(k) = (4^k - 1)/3, one gets a(n) = A182512(k) = (16^k - 1)/5, whence a(n)/n = (4^k + 1)*3/5 = (n*9 + 6)/5, smaller than the bound.
If L(a(n)) < 2 L(n) - 1, then log_2(a(n)) < floor(log_2(a(n))+1) = L(a(n)) <= 2*L(n) - 2 = 2*floor(log_2(n)+1)-2 = 2*floor(log_2(n)) <= 2*log_2(n), whence a(n) < n^2.
It remains to consider the case L(a(n)) = 2 L(n) - 1. There are two possibilities:
If n = 10..._2, then n >= 2^(L(n)-1) and a(n) = 1100..._2 < 1101_2 * 2^(L(a(n))-4) = 13*2^(2*L(n)-5), so a(n)/n^2 < 13*2^(-5+2) = 13/8 = 1.625 < 9/5 = 1.8.
If n = 11..._2, then n >= 3*2^(L(n)-2) and a(n) = 111..._2 < 2^L(a(n)) = 2^(2*L(n)-1), so a(n)/n^2 < 2^(-1+4)/9 = 8/9 < 1 < 9/5.
This shows that a(n)/n^2 <= 9/5 + 12/(5*n) always holds, with equality iff n is in A020988; and a(n)/n^2 < 13/8 if n is not in A020988 or A002450. (End)
From M. F. Hasler, Sep 10 2018: (Start)
Right inverse of A318921: A318921 o A175046 = id (= A001477).
a(A020988(k)) = A108020(k); a(A002450(k)) = A182512(k); a(A000225(k)) = A000225(k+1) (achieves the lower bound a(n) >= 2n + 1) for all k >= 0. (End)
From David A. Corneth, Sep 20 2018: (Start)
a(4*k) = 2*a(2*k).
a(4*k+1) = 4*a(2*k) + 3.
a(4*k+2) = 4*a(2*k+1).
a(4*k+3) = 2*a(2*k+1) + 1. (End)

Extensions

Extended by Ray Chandler, Dec 18 2009

A296368 Coordination sequence for the Cairo or dual-3.3.4.3.4 tiling with respect to a trivalent point.

Original entry on oeis.org

1, 3, 8, 12, 15, 20, 25, 28, 31, 36, 41, 44, 47, 52, 57, 60, 63, 68, 73, 76, 79, 84, 89, 92, 95, 100, 105, 108, 111, 116, 121, 124, 127, 132, 137, 140, 143, 148, 153, 156, 159, 164, 169, 172, 175, 180, 185, 188, 191, 196, 201, 204, 207, 212, 217, 220, 223, 228
Offset: 0

Views

Author

N. J. A. Sloane, Dec 21 2017

Keywords

Comments

There are two types of point in this tiling. This is the coordination sequence with respect to a point of degree 3.
The coordination sequence with respect to a point of degree 4 (see second illustration) is simply 1, 4, 8, 12, 16, 20, ..., the same as the coordination sequence for the 4.4.4.4 square grid (A008574). See the CGS-NJAS link for the proof.

References

  • Branko Grünbaum and G. C. Shephard, Tilings and Patterns. W. H. Freeman, New York, 1987. See Fig. 9.1.3, drawing P_5-24, page 480.
  • Herbert C. Moore, U.S. Patents 928,320 and 928,321, Patented July 20 1909. [Shows Cairo tiling.]

Crossrefs

For partial sums see A296909.
List of coordination sequences for uniform planar nets: A008458 (the planar net 3.3.3.3.3.3), A008486 (6^3), A008574 (4.4.4.4 and 3.4.6.4), A008576 (4.8.8), A008579 (3.6.3.6), A008706 (3.3.3.4.4), A072154 (4.6.12), A219529 (3.3.4.3.4), A250120 (3.3.3.3.6), A250122 (3.12.12).
List of coordination sequences for Laves tilings (or duals of uniform planar nets): [3,3,3,3,3.3] = A008486; [3.3.3.3.6] = A298014, A298015, A298016; [3.3.3.4.4] = A298022, A298024; [3.3.4.3.4] = A008574, A296368; [3.6.3.6] = A298026, A298028; [3.4.6.4] = A298029, A298031, A298033; [3.12.12] = A019557, A298035; [4.4.4.4] = A008574; [4.6.12] = A298036, A298038, A298040; [4.8.8] = A022144, A234275; [6.6.6] = A008458.

Programs

  • Mathematica
    Join[{1, 3, 8}, LinearRecurrence[{2, -2, 2, -1}, {12, 15, 20, 25}, 100]] (* Jean-François Alcover, Aug 05 2018 *)
  • PARI
    \\ See Links section.

Formula

The simplest formula is: a(0)=1, a(1)=2, a(2)=8, and thereafter a(n) = 4n if n is odd, 4n - 1 if n == 0 (mod 4), and 4n+1 if n == 2 (mod 4). (See the CGS-NJAS link for proof. - N. J. A. Sloane, May 10 2018)
a(n + 4) = a(n) + 16 for any n >= 3. - Rémy Sigrist, Dec 23 2017 (See the CGS-NJAS link for a proof. - N. J. A. Sloane, Dec 30 2017)
G.f.: -(x^6-x^5-2*x^4-4*x^2-x-1)/((x^2+1)*(x-1)^2).
From Colin Barker, Dec 23 2017: (Start)
a(n) = (8*n - (-i)^n - i^n) / 2 for n>2, where i=sqrt(-1).
a(n) = 2*a(n-1) - 2*a(n-2) + 2*a(n-3) - a(n-4) for n>6.
(End)

Extensions

Terms a(8)-a(20) and RCSR link from Davide M. Proserpio, Dec 22 2017
More terms from Rémy Sigrist, Dec 23 2017

A323286 Choix de Bruxelles (version 1): irregular table read by rows in which row n lists all the legal numbers that can be reached by halving or doubling some substring of the decimal expansion of n.

Original entry on oeis.org

2, 1, 4, 6, 2, 8, 10, 3, 12, 14, 4, 16, 18, 5, 20, 12, 21, 22, 6, 11, 14, 22, 24, 16, 23, 26, 7, 12, 18, 24, 28, 25, 30, 110, 8, 13, 26, 32, 112, 27, 34, 114, 9, 14, 28, 36, 116, 29, 38, 118, 10, 40, 11, 22, 41, 42, 11, 12, 21, 24, 42, 44, 13, 26, 43, 46, 12
Offset: 1

Views

Author

N. J. A. Sloane, Jan 14 2019

Keywords

Comments

Take the decimal expansion of n, say n = d_1 d_2 ... d_k. We can choose to map it to any number that can be obtained by the following process. Take any substring d_i, d_{i+1}..., d_j that does not begin with 0. If the number represented by this substring is odd, replace it with twice the number. If it is even either halve it or double it.
The substring may increase or decrease in length. We do not pad it with zeros if it decreases in length.
For example, if n = 20129, then by acting on single-digit substrings we get 10129, 40129, 20229, 20119, 20149, 201218. Acting on 2-digit substrings we get in addition 2069 (halve the 12!), 20249, 20158. From 3-digit substrings we also get 40229, 20258; from 4-digit substrings we get 40249; and from 5-digit substrings we get 40258.
Eric Angelini asks what is the smallest number of steps needed to reach n if we start at 1 and repeatedly apply this process? We can reach 2 in 1 step, 4 in 2 steps, 13 in five steps, and so on.
Lars Blomberg has shown, by considering just the final digit of the numbers in the trajectory, that no number ending in 0 or 5 can be reached from 1. All other numbers can be reached (cf. A323454) - see proof below.
Update, Jan 15 2019: Lorenzo Angelini has found that 3 can be reached from 1 in 11 steps: 1, 2, 4, 8, 16, 112, 56, 28, 14, 12, 6, 3. No shorter path is possible.
From N. J. A. Sloane, Jan 16 2019: (Start)
Theorem: If k > 1 does not end in 0 or 5 then it can be reached from 1.
Proof: Suppose not, and let k be the smallest such number. Note that the allowed operations are invertible: if a -> b then also b -> a. So that means that
*** all the descendants of k must be bigger than k ***
(if there was a descendant < k, then it would also be unreachable from 1, which is a contradiction to k being the smallest).
All digits of k must be odd (if there were an even digit > 0, halve it and get a smaller number; if there is a zero digit, say we see a0, then we halve a0 and get a smaller number).
If all the digits of k are 1, do 111...1 -> 111...2 -> 55..56, a smaller number.
If there is a digit 3, 7, or 9, we know we can get that single digit down to 1 (see A323454), again a contradiction.
But all the digits can't be 5. QED (End)

Examples

			The triangle begins:
   2;
   1,   4;
   6;
   2,   8;
  10;
   3,  12;
  14;
   4,  16;
  18;
   5,  20;
  12,  21,  22;
   6,  11,  14,  22,  24;
  16,  23,  26;
   7,  12,  18,  24,  28;
  25,  30, 110;
   8,  13,  26,  32, 112;
  27,  34, 114;
   9,  14,  28,  36, 116;
  29,  38, 118;
  10,  40;
  11,  22,  41,  42;
  11,  12,  21,  24,  42,  44;
  ...
		

References

  • Eric Angelini, Email to N. J. A. Sloane, Jan 14 2019.

Crossrefs

The number of terms in row n is given by A323287.
See A323460 for the (preferred) version 2 where n can also be mapped to itself.
See also A323288 (row maxima), A323289, A323452, A323453, A323454, A323455 (a binary analog).
For variants of the Choix de Bruxelles operation, see A337321 and A337357.

Programs

  • PARI
    See Sigrist link.
    
  • Python
    def cdb(n):
        s, out = str(n), set()
        for l in range(1, len(s)+1):
            for i in range(len(s)+1-l):
                if s[i] == '0': continue
                t = int(s[i:i+l])
                out.add(int(s[:i] + str(2*t) + s[i+l:]))
                if t&1 == 0: out.add(int(s[:i] + str(t//2) + s[i+l:]))
        return sorted(out)
    print([c for n in range(1, 25) for c in cdb(n)]) # Michael S. Branicky, Jul 24 2022

Extensions

Data corrected by Rémy Sigrist, Jan 15 2019
Showing 1-10 of 32 results. Next