login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A241946 Numbers n equal to the sum of all the four-digit numbers formed without repetition from the digits of n. 2

%I #12 May 17 2014 04:03:51

%S 1001,1111,1221,1331,1441,1551,1661,1771,1881,1991,2002,2112,2222,

%T 2332,2442,2552,2662,2772,2882,2992,3003,3113,3223,3333,3443,3553,

%U 3663,3773,3883,3993,4004,4114,4224,4334,4444,4554,4664,4774,4884,4994,5005,5115,5225

%N Numbers n equal to the sum of all the four-digit numbers formed without repetition from the digits of n.

%C Let d(1)d(2)... d(q) denote the decimal expansion of a number n. Any decimal expansion of four-digits d(i)d(j)d(k)d(l) formed from the digits of n is such that i<j<k<l or i>j>k>l.

%C This sequence is interesting because it contains more than just the only trivial palindromic values 1001, 1111, 1221,... The sequence is given by the union of subsets {palindromes with four digits from A056524} union {37323, 48015, 72468, 152658} and contains 94 elements. The last four elements are non-palindromic numbers.

%C But the generalization of this problem seems difficult, for example the case with the sum of all the three-digit numbers formed without repetition from the digits of n gives only 90 palindromic numbers 101, 111, 121,..., 989,999.

%H Michel Lagneau, <a href="/A241946/b241946.txt">Table of n, a(n) for n = 1..93</a>

%e 37323 is in the sequence because 37323 = 2373 + 3233 + 3237 + 3273 + 3323 + 3373 + 3723 + 3732 + 3733 + 7323.

%p with(numtheory):

%p for n from 1000 to 10000 do:

%p lst:={}:k:=0:x:=convert(n,base,10):n1:=nops(x):

%p for i from 1 to n1 do:

%p for j from i+1 to n1 do:

%p for m from j+1 to n1 do:

%p for q from m+1 to n1 do:

%p lst:=lst union {x[i]+10*x[j]+100*x[m]+1000*x[q]}:

%p od:

%p od:

%p od:

%p od:

%p for a from n1 by -1 to 1 do:

%p for b from a-1 by -1 to 1 do:

%p for c from b-1 by -1 to 1 do:

%p for d from c-1 by -1 to 1 do:

%p lst:=lst union

%p {x[a]+10*x[b]+100*x[c]+1000*x[d]}:

%p od:

%p od:

%p od:

%p od:

%p n2:=nops(lst):s:=sum('lst[i]', 'i'=1..n2):

%p if s=n

%p then

%p printf(`%d, `,n):

%p else

%p fi:

%p od:

%Y Cf. A241899.

%K nonn,base,fini,full

%O 1,1

%A _Michel Lagneau_, May 03 2014

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 12:29 EDT 2024. Contains 371937 sequences. (Running on oeis4.)