[go: up one dir, main page]

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

Showing all changes.
Numbers n with k digits in base x (MSD(n)=d_k, LSD(n)=d_1) such that, chosen one of their digits in position d_k < j < d_1, is Sum_{i=j..k}{(i-j+1)*d_i} = Sum_{i=1..j-1}{(j-i)*d_i}. Case x = 2.
(history; published version)
#8 by Bruno Berselli at Thu May 30 08:59:34 EDT 2019
STATUS

editing

approved

#7 by Paolo P. Lava at Tue May 28 07:04:24 EDT 2019
MAPLE

with(numtheory): P:=proc(q, n, h) local a, b, d, j, k, : a:=convert(n, s; base, h):

for n k from 1 to q nops(a)-1 do a:=convert(n, base, h);

for k from 1 to trunc(nops(a)/2) do b:=a[k]; a[k]:=a[nops(a)-k+1]; a[nops(a)-k+1]:=b; od;

for k from 1 to nops(a)-1 do d:=0; s:=0;

for j from 1 to k do if a[j]>0 then s:=s+a[j]*(k-j+1); fi; od; for j from nops(a) by -1 to k+1 do

if a[j]>0 then d:=d+a[j]*(j-k); fi; od; if d=s then print(n); break; fi; od; od; end: P(10^3, 2);

if add(a[j]*(k-j+1), j=1..k)=add(a[j]*(j-k), j=k+1..nops(a))

then RETURN(n); break: fi: od: end: seq(P(i, 2), i=1..10^3);

STATUS

approved

editing

#6 by Bruno Berselli at Wed Feb 15 03:29:22 EST 2017
STATUS

proposed

approved

#5 by Paolo P. Lava at Mon Feb 13 09:07:29 EST 2017
STATUS

editing

proposed

#4 by Paolo P. Lava at Tue Feb 07 09:05:15 EST 2017
AUTHOR

Paolo P. Lava, _Giovanni Resta_, Feb 07 2017

#3 by Paolo P. Lava at Tue Feb 07 07:30:31 EST 2017
NAME

allocated for Paolo P. Lava

Numbers n with k digits in base x (MSD(n)=d_k, LSD(n)=d_1) such that, chosen one of their digits in position d_k < j < d_1, is Sum_{i=j..k}{(i-j+1)*d_i} = Sum_{i=1..j-1}{(j-i)*d_i}. Case x = 2.

DATA

3, 6, 9, 12, 15, 18, 19, 24, 25, 30, 33, 36, 38, 45, 48, 50, 51, 60, 63, 66, 69, 72, 75, 76, 81, 87, 90, 96, 100, 102, 105, 117, 120, 126, 129, 131, 132, 138, 143, 144, 150, 152, 153, 162, 165, 174, 179, 180, 189, 192, 193, 195, 200, 204, 205, 210, 219, 231, 234

OFFSET

1,1

COMMENTS

All the palindromic numbers in base 2 with an even number of digits belong to the sequence.

Here the fulcrum is between two digits while in the sequence from A282107 to A282115 is one of the digits.

LINKS

Paolo P. Lava, <a href="/A282143/b282143.txt">Table of n, a(n) for n = 1..10000</a>

EXAMPLE

143 in base 2 is 10001111. If we split the number in 10001 and 111 we have 1*1 + 0*2 + 0*3 + 0*4 + 1*5 = 6 for the left side and 1*1 + 1*2 + 1*3 = 6 for the right one.

MAPLE

with(numtheory): P:=proc(q, h) local a, b, d, j, k, n, s;

for n from 1 to q do a:=convert(n, base, h);

for k from 1 to trunc(nops(a)/2) do b:=a[k]; a[k]:=a[nops(a)-k+1]; a[nops(a)-k+1]:=b; od;

for k from 1 to nops(a)-1 do d:=0; s:=0;

for j from 1 to k do if a[j]>0 then s:=s+a[j]*(k-j+1); fi; od; for j from nops(a) by -1 to k+1 do

if a[j]>0 then d:=d+a[j]*(j-k); fi; od; if d=s then print(n); break; fi; od; od; end: P(10^3, 2);

CROSSREFS
KEYWORD

allocated

nonn,base,easy

AUTHOR

Paolo P. Lava, Feb 07 2017

STATUS

approved

editing

#2 by Paolo P. Lava at Tue Feb 07 03:36:21 EST 2017
KEYWORD

allocating

allocated

#1 by Paolo P. Lava at Tue Feb 07 03:36:21 EST 2017
NAME

allocated for Paolo P. Lava

KEYWORD

allocating

STATUS

approved