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

A001411 Number of n-step self-avoiding walks on square lattice.

Original entry on oeis.org

1, 4, 12, 36, 100, 284, 780, 2172, 5916, 16268, 44100, 120292, 324932, 881500, 2374444, 6416596, 17245332, 46466676, 124658732, 335116620, 897697164, 2408806028, 6444560484, 17266613812, 46146397316, 123481354908, 329712786220, 881317491628
Offset: 0

Views

Author

Keywords

References

  • B. Bollobas and O. Riordan, Percolation, Cambridge, 2006, see p. 15.
  • Steven R. Finch, Mathematical Constants, Cambridge, 2003, section 5.10, pp. 331-338.
  • B. D. Hughes, Random Walks and Random Environments, Oxford 1995, vol. 1, p. 461.
  • 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).

Crossrefs

Twice A002900.

Programs

  • Maple
    noloop:=X->evalb(nops(X)=nops({op(X)})):
    extend:=proc(L) local L1,U,X,res:
       U:=[[1,0],[0,1],[-1,0],[0,-1]]:
       res:=NULL:for X in U do L1:=[op(L),L[nops(L)]+X]:
       if noloop(L1) then res:=res,L1 fi od:
       return(res) end:
    walks:={[[0,0]]}: A001411:=1:
    to 12 do walks:=map(x->extend(x),walks): A001411:=A001411,nops(walks) od:
    [A001411];
    # Robert FERREOL, Mar 29 2019
  • Mathematica
    mo=Tuples[{-1,1}, 2]; a[0]=1; a[tg_, p_:{{0,0}}] := Block[{e, mv = Complement[Last[p]+# & /@ mo, p]}, If[tg == 1, Length@mv, Sum[a[tg-1, Append[p, e]], {e, mv}]]]; a /@ Range[0, 10] (* Giovanni Resta, May 06 2016 *)
  • Python
    def add(L,x):
        M=[y for y in L];M.append(x)
        return(M)
    plus=lambda L,M : [x+y for x,y in zip(L,M)]
    mo=[[1,0],[0,1],[-1,0],[0,-1]]
    def a(n,P=[[0,0]]):
        if n==0: return(1)
        mv1=[plus(P[-1],x) for x in mo]
        mv2=[x for x in mv1 if x not in P]
        if n==1: return(len(mv2))
        else: return(sum(a(n-1,add(P,x)) for x in mv2))
    [a(n) for n in range(11)]
    # Robert FERREOL, Nov 30 2018; after the Mathematica program.

A046661 Number of n-step self-avoiding walks on the square lattice with first step specified.

Original entry on oeis.org

1, 3, 9, 25, 71, 195, 543, 1479, 4067, 11025, 30073, 81233, 220375, 593611, 1604149, 4311333, 11616669, 31164683, 83779155, 224424291, 602201507, 1611140121, 4316653453, 11536599329, 30870338727, 82428196555, 220329372907
Offset: 1

Views

Author

Keywords

Comments

Used as the denominator for the mean square displacement of all different self-avoiding n-step walks in A078797. - Hugo Pfoertner, Dec 09 2002
Number of ways a toy snake with n segments can be bent without flipping the snake upside down. Each segment must be perpendicular or parallel with each adjacent segment. A "slither" is a way of writing down the configuration of a snake; starting from the tail, write down which direction the next segment is pointing (R for right, S for straight, L for left). E.g., a snake with 10 segments may have the valid slither RLRRLLRRL, but not RSRRSSLSL.

Crossrefs

Programs

  • Mathematica
    (* b = A001411 *) mo = Tuples[{-1, 1}, 2]; b[0] = 1; b[tg_, p_:{{0, 0}}] := b[tg, p] = Block[{e, mv = Complement[Last[p] + #& /@ mo, p]}, If[tg == 1, Length[mv], Sum[b[tg - 1, Append[p, e]], {e, mv}]]];
    a[n_] := b[n]/4;
    Table[an = a[n]; Print[an]; an, {n, 1, 16}] (* Jean-François Alcover, Nov 02 2018, after Giovanni Resta in A001411 *)

Formula

a(n) = A001411(n)/4 = A002900(n)/2.

A097292 Rectangular array T, by antidiagonals: T(n,k) = rank of n in A097291 at which the pair (n,k) occurs.

Original entry on oeis.org

1, 2, 4, 5, 3, 9, 10, 8, 7, 16, 17, 13, 6, 12, 25, 26, 20, 15, 14, 19, 36, 37, 29, 22, 11, 21, 28, 49, 50, 40, 31, 24, 23, 30, 39, 64, 65, 53, 42, 33, 18, 32, 41, 52, 81, 82, 68, 55, 44, 35, 34, 43, 54, 67, 100, 101, 85, 70, 57, 46, 27, 45, 56, 69, 84, 121
Offset: 1

Views

Author

Clark Kimberling, Aug 05 2004

Keywords

Comments

Row 1 is A002522.
Column 1 (squares) is A002900.
Main diagonal is 2+(n-1)^2 for n>1, cf. A010000.

Examples

			Northwest corner:
   1  2  5  10
   4  3  8  13
   9  7  6  15
  16 12 14  11
T(3,4) = 15 because in A097291, the pair 3,4 occurs at positions 15,16.
		

Crossrefs

Showing 1-3 of 3 results.