A033075
Positive numbers all of whose pairs of consecutive decimal digits differ by 1.
Original entry on oeis.org
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 21, 23, 32, 34, 43, 45, 54, 56, 65, 67, 76, 78, 87, 89, 98, 101, 121, 123, 210, 212, 232, 234, 321, 323, 343, 345, 432, 434, 454, 456, 543, 545, 565, 567, 654, 656, 676, 678, 765, 767, 787, 789, 876
Offset: 1
-
-- import Data.Set (fromList, deleteFindMin, insert)
a033075 n = a033075_list !! (n-1)
a033075_list = f (fromList [1..9]) where
f s | d == 0 = m : f (insert (10*m+1) s')
| d == 9 = m : f (insert (10*m+8) s')
| otherwise = m : f (insert (10*m+d-1) (insert (10*m+d+1) s'))
where (m,s') = deleteFindMin s
d = mod m 10
-- Reinhard Zumkeller, Feb 21 2012
-
Join[Range[9],Select[Range[2000],Union[Abs[Differences[IntegerDigits[#]]]]=={1}&]] (* Harvey P. Dale, Dec 28 2011 *)
-
diff(v)=vector(#v-1,i,v[i+1]-v[i])
is(n)=if(n>9, Set(abs(diff(digits(n))))==[1], n>0) \\ Charles R Greathouse IV, Mar 11 2014
-
def ok(n):
s = str(n)
return all(abs(int(s[i]) - int(s[i+1])) == 1 for i in range(len(s)-1))
print(list(filter(ok, range(1, 877)))) # Michael S. Branicky, Aug 22 2021
-
# faster version for initial segment of sequence
def gen(d, s=None): # generate remaining d digits, from start digit s
if d == 0:
yield tuple()
return
if s == None:
yield from [(i, ) + g for i in range(1, 10) for g in gen(d-1, s=i)]
else:
if s > 0:
yield from [(s-1, ) + g for g in gen(d-1, s=s-1)]
if s < 9:
yield from [(s+1, ) + g for g in gen(d-1, s=s+1)]
def agentod(digits):
for d in range(1, digits+1):
yield from [int("".join(map(str, g))) for g in gen(d, s=None)]
print(list(agentod(11))) # Michael S. Branicky, Aug 22 2021
A090989
Number of meaningful differential operations of the n-th order on the space R^4.
Original entry on oeis.org
4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128, 192, 256, 384, 512, 768, 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576, 32768, 49152, 65536, 98304, 131072, 196608, 262144, 393216, 524288, 786432, 1048576, 1572864, 2097152, 3145728, 4194304, 6291456, 8388608
Offset: 1
- G. C. Greubel, Table of n, a(n) for n = 1..1000
- Branko Malesevic, Some combinatorial aspects of differential operation composition on the space R^n , Univ. Beograd, Publ. Elektrotehn. Fak., Ser. Mat. 9 (1998), 29-33.
- Branko Malesevic, Some combinatorial aspects of differential operation compositions on space R^n, arXiv:0704.0750 [math.DG], 2007.
- Index entries for linear recurrences with constant coefficients, signature (0,2).
-
a:=[4,6];; for n in [3..40] do a[n]:=2*a[n-2]; od; a; # G. C. Greubel, Feb 02 2019
-
m:=40; R:=PowerSeriesRing(Integers(), m); Coefficients(R!( 2*x*(2+3*x)/(1-2*x^2) )); // G. C. Greubel, Feb 02 2019
-
NUM := proc(k :: integer) local i,j,n,Fun,Identity,v,A; n := 4; # <- DIMENSION Fun := (i,j)->piecewise(((j=i+1) or (i+j=n+1)),1,0); Identity := (i,j)->piecewise(i=j,1,0); v := matrix(1,n,1); A := piecewise(k>1,(matrix(n,n,Fun))^(k-1),k=1,matrix(n,n,Identity)); return(evalm(v&*A&*transpose(v))[1,1]); end:
-
LinearRecurrence[{0,2}, {4,6}, 40] (* G. C. Greubel, Feb 02 2019 *)
-
my(x='x+O('x^40)); Vec(2*x*(2+3*x)/(1-2*x^2)) \\ G. C. Greubel, Feb 02 2019
-
(2*(2+3*x)/(1-2*x^2)).series(x, 40).coefficients(x, sparse=False) # G. C. Greubel, Feb 02 2019
A090995
Number of meaningful differential operations of the n-th order on the space R^10.
Original entry on oeis.org
10, 18, 32, 58, 104, 188, 338, 610, 1098, 1980, 3566, 6428, 11580, 20870, 37602, 67762, 122096, 220018, 396448, 714388, 1287266, 2319594, 4179738, 7531660, 13571542, 24455124, 44066548, 79405254, 143083226, 257827186, 464588384
Offset: 1
- G. C. Greubel, Table of n, a(n) for n = 1..1000
- B. Malesevic, Some combinatorial aspects of differential operation composition on the space R^n, Univ. Beograd, Publ. Elektrotehn. Fak., Ser. Mat. 9 (1998), 29-33.
- Branko Malesevic, Some combinatorial aspects of differential operation compositions on space R^n, arXiv:0704.0750 [math.DG], 2007.
- Joseph Myers, BMO 2008--2009 Round 1 Problem 1---Generalisation
- Index entries for linear recurrences with constant coefficients, signature (1,2,-1).
-
a:=[10,18,32];; for n in [4..30] do a[n]:=a[n-1]+2*a[n-2]-a[n-3]; od; a; # G. C. Greubel, Feb 02 2019
-
m:=40; R:=PowerSeriesRing(Integers(), m); Coefficients(R!( 2*x*(5+4*x-3*x^2)/(1-x-2*x^2+x^3) )); // G. C. Greubel, Feb 02 2019
-
NUM := proc(k :: integer) local i,j,n,Fun,Identity,v,A; n := 10; # <- DIMENSION Fun := (i,j)->piecewise(((j=i+1) or (i+j=n+1)),1,0); Identity := (i,j)->piecewise(i=j,1,0); v := matrix(1,n,1); A := piecewise(k>1,(matrix(n,n,Fun))^(k-1),k=1,matrix(n,n,Identity)); return(evalm(v&*A&*transpose(v))[1,1]); end:
-
a[n_ /; n <= 6] := {10, 18, 32, 58, 104, 188}[[n]]; a[n_] := a[n] = 5*a[n-2] - 6*a[n-4] + a[n-6]; Array[a, 31] (* Jean-François Alcover, Oct 07 2017 *)
2*LinearRecurrence[{1,2,-1}, {5,9,16}, 40] (* G. C. Greubel, Feb 02 2019 *)
-
my(x='x+O('x^40)); Vec(2*x*(5+4*x-3*x^2)/(1-x-2*x^2+x^3)) \\ G. C. Greubel, Feb 02 2019
-
a=(2*x*(5+4*x-3*x^2)/(1-x-2*x^2+x^3)).series(x, 40).coefficients(x, sparse=False); a[1:] # G. C. Greubel, Feb 02 2019
A090990
Number of meaningful differential operations of the n-th order on the space R^5.
Original entry on oeis.org
5, 9, 16, 29, 52, 94, 169, 305, 549, 990, 1783, 3214, 5790, 10435, 18801, 33881, 61048, 110009, 198224, 357194, 643633, 1159797, 2089869, 3765830, 6785771, 12227562, 22033274, 39702627, 71541613, 128913593, 232294192, 418579765
Offset: 1
- G. C. Greubel, Table of n, a(n) for n = 1..1000
- Branko Malesevic, Some combinatorial aspects of differential operation composition on the space R^n, Univ. Beograd, Publ. Elektrotehn. Fak., Ser. Mat. 9 (1998), 29-33.
- Branko Malesevic, Some combinatorial aspects of differential operation composition on the space R^n, arXiv:0704.0750 [math.DG], 2007.
- Branko Malesevic and I. Jovovic, The Compositions of the Differential Operations and Gateaux Directional Derivative, arXiv:0706.0249 [math.CO], 2007.
- Index entries for linear recurrences with constant coefficients, signature (1,2,-1).
-
a:=[5,9,16];; for n in [4..30] do a[n]:=a[n-1]+2*a[n-2]-a[n-3]; od; a; # G. C. Greubel, Feb 02 2019
-
m:=40; R:=PowerSeriesRing(Integers(), m); Coefficients(R!( x*(5+4*x-3*x^2)/(1-x-2*x^2+x^3) )); // G. C. Greubel, Feb 02 2019
-
NUM := proc(k :: integer) local i,j,n,Fun,Identity,v,A; n := 5; # <- DIMENSION Fun := (i,j)->piecewise(((j=i+1) or (i+j=n+1)),1,0); Identity := (i,j)->piecewise(i=j,1,0); v := matrix(1,n,1); A := piecewise(k>1,(matrix(n,n,Fun))^(k-1),k=1,matrix(n,n,Identity)); return(evalm(v&*A&*transpose(v))[1,1]); end:
-
LinearRecurrence[{1, 2, -1}, {5, 9, 16}, 32] (* Jean-François Alcover, Nov 22 2017 *)
-
my(x='x+O('x^40)); Vec(x*(5+4*x-3*x^2)/(1-x-2*x^2+x^3)) \\ G. C. Greubel, Feb 02 2019
-
a=(x*(5+4*x-3*x^2)/(1-x-2*x^2+x^3)).series(x, 40).coefficients(x, sparse=False); a[1:] # G. C. Greubel, Feb 02 2019
More terms from
Branko Malesevic and Ivana Jovovic (ivana121(AT)EUnet.yu), Jun 21 2007
A235163
Number of positive integers with n digits in which adjacent digits differ by at most 1.
Original entry on oeis.org
9, 26, 75, 217, 629, 1826, 5307, 15438, 44941, 130900, 381444, 1111926, 3242224, 9455987, 27583372, 80472698, 234799873, 685149328, 1999414181, 5835044495, 17029601028, 49702671494, 145066398937, 423412132499, 1235854038791, 3607255734629, 10529101874491
Offset: 1
a(2) = 26: 10, 11, 12, 21, 22, 23, 32, 33, 34, 43, 44, 45, 54, 55, 56, 65, 66, 67, 76, 77, 78, 87, 88, 89, 98, 99.
-
u:= proc(n, r) option remember; `if`(n=1, `if`(r=0, 0, 1),
add(`if`(r+i in [$0..9], u(n-1, r+i), 0), i=-1..1))
end:
a:= n-> add(u(n, r), r = 0..9):
seq(a(n), n=1..30); # Alois P. Heinz, Jan 12 2014
-
CoefficientList[Series[-x*(3*x^4-18*x^3-9*x^2+28*x-9)/(x^5-6*x^4-x^3+10*x^2-6*x+1),{x,0,30}],x]//Rest (* Harvey P. Dale, Aug 13 2019 *)
-
from functools import cache
@cache
def u(n, r):
if r < 0 or r > 9: return 0
if n == 1: return (r > 0)
return u(n-1, r-1) + u(n-1, r) + u(n-1, r+1)
def a(n): return sum(u(n, r) for r in range(10))
print([a(n) for n in range(1, 28)]) # Michael S. Branicky, Sep 26 2021
A129639
Number of meaningful differential operations of the k-th order on the space R^12.
Original entry on oeis.org
12, 22, 40, 74, 136, 252, 464, 860, 1584, 2936, 5408, 10024, 18464, 34224, 63040, 116848, 215232, 398944, 734848, 1362080, 2508928, 4650432, 8566016, 15877568, 29246208, 54209408, 99852800, 185082496, 340918784, 631911168, 1163969536
Offset: 12
-
NUM := proc(k :: integer) local i,j,n,Fun,Identity,v,A; n:=12; # <- DIMENSION Fun:=(i,j)->piecewise(((j=i+1) or (i+j=n+1)),1,0); Identity:=(i,j)->piecewise(i=j,1,0); v:=matrix(1,n,1); A:=piecewise(k>1,(matrix(n,n,Fun))^(k-1),k=1,matrix(n,n,Identity)); return(evalm(v&*A&*transpose(v))[1,1]); end:
-
f[k_] := f[k] = If[k <= 17, {12, 22, 40, 74, 136, 252}[[k-11]], 6 f[k-2] - 10 f[k-4] + 4 f[k-6]];
f /@ Range[12, 42] (* Jean-François Alcover, Apr 21 2020 *)
A377000
Array read by ascending antidiagonals: T(n,k) = number of n-esthetic numbers with k digits.
Original entry on oeis.org
1, 2, 1, 3, 3, 1, 4, 5, 4, 1, 5, 7, 8, 6, 1, 6, 9, 12, 13, 8, 1, 7, 11, 16, 21, 21, 12, 1, 8, 13, 20, 29, 36, 34, 16, 1, 9, 15, 24, 37, 52, 63, 55, 24, 1, 10, 17, 28, 45, 68, 94, 108, 89, 32, 1, 11, 19, 32, 53, 84, 126, 169, 189, 144, 48, 1, 12, 21, 36, 61, 100, 158, 232, 305, 324, 233, 64, 1
Offset: 2
Array begins (cf. De Koninck and Doyon (2009), table on p. 155):
n\k| 1 2 3 4 5 6 7 8 9 10 ...
-------------------------------------------------------
2 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ... = A000012
3 | 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, ... = A029744 (from n = 2)
4 | 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, ... = A000045 (from n = 4)
5 | 4, 7, 12, 21, 36, 63, 108, 189, 324, 567, ... = A228879
6 | 5, 9, 16, 29, 52, 94, 169, 305, 549, 990, ...
7 | 6, 11, 20, 37, 68, 126, 232, 430, 792, 1468, ...
8 | 7, 13, 24, 45, 84, 158, 296, 557, 1045, 1966, ...
9 | 8, 15, 28, 53, 100, 190, 360, 685, 1300, 2475, ...
10 | 9, 17, 32, 61, 116, 222, 424, 813, 1556, 2986, ... = A090994
... \______ A152086 (main diagonal)
- Paolo Xausa, Table of n, a(n) for n = 2..11326 (first 150 antidiagonals, flattened).
- Jean-Marie De Koninck and Nicolas Doyon, Esthetic Numbers, Ann. Sci. Math. Québec 33 (2009), No. 2, pp. 155-164.
- Giovanni Resta, Esthetic Numbers, Numbers Aplenty, 2013.
- Branko J. Malesevic, Some combinatorial aspects of differential operation composition on the space R^n, Univ. Beograd, Publ. Elektrotehn. Fak., Ser. Mat. 9 (1998), 29-33 (arXiv version, arXiv:0704.0750 [math.DG], 2007).
Diagonal above the main diagonal appears to be
A206603.
-
A377000[n_, k_] := Round[2^k/(n+1)*Sum[If[m != (n+1)/2, Cos[#]^k*(Cot[#] + Csc[#])^2 & [Pi*m/(n+1)], 0], {m, 1, n, 2}]];
Table[A377000[n-k+1, k], {n, 2, 15}, {k, n-1}]
-
from itertools import count, islice
from functools import lru_cache
@lru_cache(maxsize=None)
def A377000_N(q,r,i):
if r==1 and i==0: return 0
if r==1: return 1
if q==2: return r+i&1^1
if i == 0: return A377000_N(q,r-1,1)
if i == q-1: return A377000_N(q,r-1,q-2)
return A377000_N(q,r-1,i-1)+A377000_N(q,r-1,i+1)
def A377000_T(n,k): return sum(A377000_N(n,k,i) for i in range(n))
def A377000_gen(): # generator of terms
for n in count(2):
for k in range(1,n):
yield A377000_T(n-k+1,k)
A377000_list = list(islice(A377000_gen(),100)) # Chai Wah Wu, Oct 21 2024
A116183
Array T(k,n) = number of meaningful differential operations of the n-th order on the space R^(3+k), for k=>0, n>0, read by antidiagonals.
Original entry on oeis.org
3, 4, 5, 5, 6, 8, 6, 9, 8, 13, 7, 10, 16, 12, 21, 8, 13, 16, 29, 16, 34, 9, 14, 24, 26, 52, 24, 55, 10, 17, 24, 45, 42, 94, 32, 89, 11, 18, 32, 42, 84, 68, 169
Offset: 1
Table begins:
k=0.|.3..5..8.13..21..34..55..89..144..233..377..610..987.1597...
k=1.|.4..6..8.12..16..24..32..48...64...96..128..192..256..384...
k=2.|.5..9.16.29..52..94.169.305..549..990.1783.3214.5790...
k=3.|.6.10.16.26..42..68.110.178..288..466..754.1220.1974...
k=4.|.7.13.24.45..84.158.296.557.1045.1966.3691.6942.13038...
k=5.|.8.14.24.42..72.126.216.378..648.1134.1944.3402..5832...
k=6.|.9.17.32.61.116.222.424.813.1556.2986.5721.10982...
k=7.|10.18.32.58.104.188.338.610.1098.1980.3566.6428...
A153360
Number of zig-zag paths from top to bottom of a rectangle of width 10 with n rows.
Original entry on oeis.org
10, 18, 34, 64, 122, 232, 444, 848, 1626, 3112, 5972, 11442, 21964, 42106, 80832, 155010, 297570, 570760, 1095620, 2101752, 4034252, 7739690, 14855342, 28501710, 54703004, 104959000, 201439550, 386516750, 741790648, 1423365002, 2731617694
Offset: 1
-
LinearRecurrence[{1, 4, -3, -3, 1}, {10, 18, 34, 64, 122}, 31] (* Jean-François Alcover, Jul 01 2018 *)
G.f. proposed by Maksym Voznyy checked and corrected by
R. J. Mathar, Sep 16 2009.
Showing 1-9 of 9 results.
Comments