[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Revision History for A358027 (Bold, blue-underlined text is an addition; faded, red-underlined text is a deletion.)

Showing entries 1-10 | older changes
Expansion of g.f.: (1 + x - 2*x^2 + 2*x^4)/((1-x)*(1-3*x^2)).
(history; published version)
#29 by Michel Marcus at Tue Nov 01 03:30:41 EDT 2022
STATUS

reviewed

approved

#28 by Joerg Arndt at Tue Nov 01 03:14:07 EDT 2022
STATUS

proposed

reviewed

#27 by G. C. Greubel at Mon Oct 31 04:29:34 EDT 2022
STATUS

editing

proposed

#26 by G. C. Greubel at Mon Oct 31 04:27:41 EDT 2022
LINKS

<a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (1,1,13,-3).

FORMULA

a(n) = a(n-1) - 3*a(n-2) + 3*a(n-3), for n >= 5.

MATHEMATICA

LinearRecurrence[{1, 1, 13, -3}, {1, 2, 3, 6, 11}, 61]

PROG

(Magma) I:=[3, 6, 11]; [1, 2] cat [n le 3 select I[n ] else Self(n-1) +3*Self(n-2) +-3*Self(n-3): n in [1..60]];

@CachedFunction

def A254006(n): return 3^(n/2)*(1 + (-1)^n)/2

def aA358027(n): return (n+1/3) if *( 4*A254006(n<3) else a+ 7*A254006(n-1) +a2*int(n-==0) + 2) +a*int(n==1) - 3 ) # a = A047081

[aA358027(n) for n in (0..60)]

Discussion
Mon Oct 31
04:29
G. C. Greubel: This sequence is the data from A047081. The data for A047081 is/was in error in relation to sequence A047080 of which it is based upon. This sequence is part of a class of gf's that have the form f(x)/((1-x)*(1-3*x^2)) and seems reasonable to keep in the Oeis.
#25 by G. C. Greubel at Mon Oct 31 03:41:41 EDT 2022
NAME

allocated for G. C. Greubel

Expansion of g.f.: (1 + x - 2*x^2 + 2*x^4)/((1-x)*(1-3*x^2)).

DATA

1, 2, 3, 6, 11, 20, 35, 62, 107, 188, 323, 566, 971, 1700, 2915, 5102, 8747, 15308, 26243, 45926, 78731, 137780, 236195, 413342, 708587, 1240028, 2125763, 3720086, 6377291, 11160260, 19131875, 33480782, 57395627

OFFSET

0,2

LINKS

<a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (1,1,1).

FORMULA

a(n) = (1/3)*(2*[n=0] + 2*[n=1] - 3 + 4*A254006(n) + 7*A254006(n-1))).

E.g.f.: (1/3)*( 2 + 2*x - 3*exp(x) + 4*cosh(sqrt(3)*x) + (7/sqrt(3))*sinh(sqrt(3)*x) ).

G.f.: (1 +x -2*x^2 +2*x^4)/((1-x)*(1-3*x^2)). - Clark Kimberling, Oct 31 2022

MATHEMATICA

LinearRecurrence[{1, 1, 1}, {1, 2, 3}, 61]

PROG

(Magma) [n le 3 select n else Self(n-1) +Self(n-2) +Self(n-3): n in [1..60]];

(SageMath)

@CachedFunction

def a(n): return (n+1) if (n<3) else a(n-1) +a(n-2) +a(n-3) # a = A047081

[a(n) for n in (0..60)]

CROSSREFS
KEYWORD

allocated

easy,nonn

AUTHOR

G. C. Greubel, Oct 31 2022

STATUS

approved

editing

#24 by G. C. Greubel at Mon Oct 31 03:41:41 EDT 2022
NAME

allocated for G. C. Greubel

KEYWORD

recycled

allocated

#23 by Peter Luschny at Mon Oct 31 02:33:36 EDT 2022
STATUS

reviewed

approved

#22 by Michel Marcus at Mon Oct 31 02:02:56 EDT 2022
STATUS

proposed

reviewed

#21 by Joerg Arndt at Mon Oct 31 01:43:27 EDT 2022
STATUS

editing

proposed

#20 by Joerg Arndt at Mon Oct 31 01:43:21 EDT 2022
NAME

Distinct digital permutations of the first m terms of A033307 arranged lexicographically, for m = 1, 2, 3, ...

DATA

1, 12, 21, 123, 132, 213, 231, 312, 321, 1234, 1243, 1324, 1342, 1423, 1432, 2134, 2143, 2314, 2341, 2413, 2431, 3124, 3142, 3214, 3241, 3412, 3421, 4123, 4132, 4213, 4231, 4312, 4321, 12345, 12354, 12435, 12453, 12534, 12543, 13245, 13254, 13425, 13452, 13524

OFFSET

1,2

COMMENTS

Permutations starting with the digit 0 are omitted.

PROG

(Python)

from itertools import islice, count

from sympy.utilities.iterables import multiset_permutations as mp

def bgen(): yield from (c for n in count(1) for c in str(n))

def agen():

s, g = "", bgen()

while True:

s += next(g)

yield from (int("".join(p)) for p in mp(s) if p[0] != "0")

print(list(islice(agen(), 50))) # Michael S. Branicky, Oct 25 2022

(Python)

def toint(l):

a=0; L=len(l); p=1

for i in range(L-1, -1, -1):

a+=l[i]*p; p*=10

return a

def f(n):

tot=0; L=0; ans=[]

while 1:

L+=1; cont=0; cur=1; d=[]

while cont<L:

cur1=cur; cur+=1

cur1=str(cur1)

while cur1:

lc=cur1[0]; cur1=cur1[1:]; d.append(int(lc)); cont+=1

if cont==L:

break

d=sorted(d)

if d[0]==0:

d.remove(1);

d=[1]+d

while 1:

ans.append(toint([*d])); tot+=1

if tot==n:

return ans

j=L-2

while j>-1:

if d[j]<d[j+1]:

for k in range(j+1, L):

if k==L-1:

d[j], d[k]=d[k], d[j]; d=d[:j+1]+sorted(d[j+1:])

elif d[k+1]<=d[j]:

d[j], d[k]=d[k], d[j]; d=d[:j+1]+sorted(d[j+1:]); break

break

j-=1

if j==-1:

break

print(f(10000)) # Michele Botta, Oct 25 2022

CROSSREFS
KEYWORD

easy,nonn,base,changed

recycled

AUTHOR

Michele Botta and Marco Ripà, Oct 25 2022

STATUS

proposed

editing