NUMBER GAMES
BY ROBERT
T. KUROSAKA
Bob teaches
some familiar old tricks to a
new machine
Here's an old number tnck
StcHI with any four-d1g1t
number. s y. 3917 Form a
new number by arranging its
d1g1ts m decreasmg order.
9731. and another w1th the
dJgJts in increasing ord r.
13 79 Fmd the difference of
these numbers. 83 52 Repeat the procedur with 8352 8532 - 2358 ~
617 4. Another repetitiOn produces
7641- ! 467~6174 W c;eethatfurther repeti ions will yield an endless
sequence of 6174s
Que tions anse immediately Will all
four-dig1t numbers eventually arrive at
this or some other sel -replicating
value? Which numbers require the
most steps before they are repeated?
It turns out that all four-digtt numbers
t xcept multtples of II Ill wtll r ach
617 4 in at mo t seven steps.
Many similar procedures exist for
generatmg repeating sequences. and
some of them produce startlmg
results Computers make the job of
xploring them far easter than the
manual method.
Whats the purpose of this intellectual thumb-twtddhng you ask. Hardly ever a practical one I admit. but
after all the name of thts column is
" M thematical Recreations"
ThL month Ill look at several number-sequence games. providing BASIC
programs that check them out (Readers are also encouraged to seek ways
of improving on my solution l
In all cases. the term numbrr will
mean pos1tiw.> integer
SUM OF CUBES
Star w1th any number say 3 52 Find
the sum of the cubes of its digtts 31 +
r;1
21 - 160. Repeat the procedure
With 160 P + 61 +- 01
217 which
m turn g1ves 21 + 11 + 71 - 352. We
already find ourselves in a loop (160.
217, 352).
Listing I is a program that performs
the sum-of-cubes routine on any set
of consecutive numbers. For a particular 11 . it prints the consecutive
sums of cubes until a loop is found.
Readers may wish to modify the program later. perhaps suppressing the
actual terms and printmg out only the
number of steps taken and the type
of loop
It has been proved that all numbers
will eventually reach one of several
loops I have seen the proof m a Mathematical AssoCiation of America journal. but I cannot find ~hat article. nor
do I remember the proof.
The following are a few of the
known loops three-step: (55. 2 50.
133). two-step (136. 244) and (919.
1459): one-step· (153). (370). (371).
and. 0f course (II .
After exploring the sum-of-cubes
procedure. readers may wish to investigdte other powers or even other
number bases.
fACTORIAL SUMS
Start w1th any number. say, 169 Find
the um of the factorials of its d1g1ts: 11
+ 6! + 9! - 363601. Repeat the process 3! + 6' + 31 + 6' + 0' + 1! 1454 Then. I!+ 41 + 5! + 4! = 169.
and we have already found a loop.
(169, 363601. 1454)
I have examined all numbers less
than 1000 and found that nearly all
of them enter this particular loop You
will 1lso find some one-step loops.
since I -= I' 2 - 2! . and 145 ~ I!+
4' -r 5! Some two-step loops are (871.
45361) and (872 45362).
Listing 2 calculates the sum
of factorials for any range of
numbers. When numbers are
set for lo-d1git precision. the
program can handle starting
values up to 9999999999.
But even this giant yields 10
x 9! - 3628800. As long as
we limit the argument to 10 d1gits at
most. no result will exceed 7 digits. Of
course. if double precision is available.
the program can be adapted to work
with even larger numbers.
PALINDROMIC SUMS
It has been said that the first man introduced himself to the first woman
with a palindrome: "Madam. I'm
Adam!' Not to be outdone. she
replied in kind. "Eve:·
Now we'll go searching for sequences that produce numeric palindromes. that is. numbers that read the
same forward and backward.
Start with any number. say. 4e
Reverse its d1gits and add the result
to the anginal number: 48 + 84 132. Repeat the procedure: 132 + 231
- 363. a palindrome.
All numbers may eventually produce palindromes using this reverseand-add routine-but that remams to
be proved. Some numbers are known
to require many steps: for example. 89
requires 24 steps.
Charles W. 1tigg, presently book
review editor for the Journal of Recreational Mathematrcs and a prolific contributor to numerous mathematics
publications. found only 249 numbers
less than I 0.000 that require more
than I 00 steps to reach a palindrome.
Among them is the dreaded 196.
which has been taken to hundreds of
(contmutd)
Robert T Kurosaka teaches mathematics in
the Massachusetts State CDllege system. He
can be reached do BYTE. One Phoenix Mill
Lane. Peterborough. NH 034 58.
AUGUST 1986 • BYTE
313
--~
.
-----..
-
.
NUMBER GAMES
MEMORIES
ADD-IN BOARDS
PIN-FOR-PIN COMPATIBLE
EASY INSTALLATION
HP 150
HP 1000
HP 3000
WANG PC
GFK
Amandastr. 60, 2000 Hamburg 6
West Germany
Phone
Telex
(40) 4301051
2162272
Dealers are invited
US Otstrtbutor :
HyPomt Technology (216] 526 -0323
Inquiry 328
COLOR
VT220$1SO·
*plus your
PC, jr, XT, AT or compatible
ZSTEMpc·VT220 Smart Tormonal Emulator
112 -cot by .,,~ .ng no adchl hardo~¥are
Oouble H.gh Oouble Wtde Chara .. ters
Full VTtOO line grap~I(:S Smooth! roU•ng
2 " tl•' translers on<l XI.'OOEM nd KERMIT
Fun ~eyboard soltke1SfMACROS
D to roles to 38 4KB H.gh Throug/>pu'
Cdor'graptucs
monochrom~ &
EGA !luppot'1
InternatiOnal Fo"l Support • OOS A.:cess
tSO and altr•bule mapped color
ZSTEMpc·VT220 $150. 4010/4014 Optoon S!lt
ZSTEMpc-VT100
Cho<ce ol the US Atr101Co
30 dat mor>et bo<k guarantee I.'C/\IISA
KEA SYSTEMS LTD.
U12 2150 W B'Oadway
1/anr:ouver. 8 C CANADA I/6K 4L9
SUPI>Orl (604 )732·7411
TELEX 04 352141 VCR
Order Toll Free (800) 663-8702
......)!.~
by
l<rrA
Inquiry 323
OC8000
E:Xp,
DS PC
PERFORMANCE AT A FRACTION
OF ElWORKJNC COST
• Adds four to e•~ht t' nal communication
ports to IBM PC, XT. AT or compatihles.
• Standard RS-232 or opttonal RS-422 ports
for lllCn.-ased transmt s10n peed aod distance.
• upported hyXentJ<, Multo-Lmk, RT S,QNX.
and other multo-user, multt -taskong operating
sy terns.
STAR GATE TECHNOLOGIES, I C.
ll
Inquiry 280
Sullt l"
81\d • bstlab, OH
C.ll (216) 9,. ·Y12l
Cun~J
~
thot4St~ttds of steps with no palindr o me
in s1ght. The same 1s true for it
"cousms." 295 and 394
Listing 3 investigates palindromic
sums for any range of numbers The
lower limit for the sequence is II. and
there is no explicit upper hmit. It d 'S
not have safeguards aoain t dubiou
numbers like 196 that produce very
k)ng sequence'> Improvement.., arl'
left to the readers ingenUit)
DELETE AND ADD
One of my favonte is the delightful
little marvel shown in the sample run
of hsting 4. Begin by listing the whole
numbe1 I through 11 You then delete
(u>I1 1J11Ut'dl
Listing I a: Tfte BASIC program to proJtiCl' cube sums 11111il a l!Jdl' rs frwtd
10 REM Sum of Cubes
20 REM by Bob Kurosoka
30 REM ---------------------------------------------------40 DIM A(10),8(100) :REH A() holds digits, B() holds sums .
50 CLS
60 PRINT "Program generates sequences of cub e sums.•
70 PRINT
80PRINT "Lower limit, upper limit";
90 INPUT LL, UL
100 LL•ABS(INT(LL))
110 UL•ABS(INT(UL))
120 REM ---------------------------------------------------130 fOR N•LL TO UL :REM Sequences for each no. LL to NN
140 SP•0
:REM SP coun t s the steps before o cycle
150 B(SP)•N
: REM Make the f irst term=N
160 PRINT B(SP);
: REM Print the current term
: REM Make o copy of latest term
170 M•B(SP)
180 REM --------------------------------------------------·-190 REM Break up the term into its comp onent digits
200 D•1
:REM D =no. of digits
210 T•INT(M/10)
: REM T • no. of "Tens" in M
220 A(D)=M-10•T
:REM Store rightmost digit in array A
230 If T<>0 THEN D=D+1: M=T: GOTO 10
240 REM ---------------------------------------------------250 REM Colculote the sum of the cubes of the digits in A( )
260 SUM=0
270 fOR I=1 TO D
280 SUM=SUM+A(I)•A(I)•A(I)
290 NEXT I
300 REM See if sum hos occurred already.
310 I•0
320 WHILE B(I)<>SUM AND I<=SP
330 I•I +1
340 WEND
350 If B(I)•SUM AND I<=SP THEN 400
:REM one more step
360 SP•SP+1
370 B(SP) .. SUM
: REM Store SUM in array B
380 GOTO 160
390 REM ---------------------------------------------------400 PRINT SUM; "* loops to step "; I
410 NEXT N
420 END
Listing I b : A samplt' run
Program generates sequences of cube sums .
Lower limi t , upper I l mi t 7 21 , 25
21 9 729 1080 513 153 153 • loops to step 5
22 16 217 352 160 217 • loops to step 2
23 35 152 134 92 737 713 371 371 • loops to step
24 72 351 153 153 • loops to step 3
25 133 55 250 133 • loops to step 1
Ok
7
NUMBER GAMES
APRaTEK 1000
ONLY
$265. 00
Listing 2a: Thr BASIC pro<Jram to produce fattorial sums until a cycle
IS
fotmd.
10 REM Sum of Factorials
20 REM by Bob Kurosoko
30 REM ----------------------------------------------------40 DIM A(10),B(100),F(10)
50 DATA 1,1,2,6,24,120,720,5040 , 40320,362880
60 FOR J=1 TO 10
70 READ F(J)
80 NEXT J
90 CLS
100 PRINT "Program generates factorial sum sequences."
110 PRINT
120 PRINT "Lower I imi t, upper I imi t ";
130 INPUT LL, UL
140 LL=ABS(IN~(LL))
150 UL=ABS(INT(UL))
160 REM ----------------------------------------------------170 FOR N=LL TO UL
:REM Sequences for each no. LL to NN
180 SP=0
:REM SP counts the steps before a cycle
190 B(SP)=N
:REM Make the first term=N
200 PRINT B(SP);
:REM Print the current term
210 M=B(SP)
:REM Make a copy of latest term
220 REM ----------------------------------------------------230 REM Break up the term into its component digits
240 D=1
:REM D = no. of digi ts
250 T•INT(M/10)
:REM T = no. of "Tens" in M
260 A(D)=M-10•T
:REM Store rightmost digit in array A
270 IF T<>0 THEN D=D+1: M=T: GOTO 250
280 REM ----------------------------------------------------290 REM Calculate the sum of the factorials of digits in A()
300 SUM=0
310 FOR I=1 TO D
320 SUM=SUM+F(A(l)+1)
330 NEXT I
340 REM See i f sum has occurred already.
350 I=0
360 WHILE B(l)<>SUM AND I<=SP
370 I=I+1
380 WEND
390 IF B(I)=SUM AND I<=SP THEN 440
400 SP,.SP+1
:REM one more step
410 B(SP)=SUM
: REM Store SUM in array B
420 GOTO 200
430 REM ----------------------------------------------------440 PRINT SUM; "* I oops to step "; I
450 PRINT
460 NEXT N
470 END
COMPLETE WITH
PERSONALITY
MODULE
117 AC POWER RS-232 CONNECT
-8 BAUD RATES HANDSHAKE TO HOST
ALLOWS READ, WRITE, VERIFY. COPY
Comes complete woth IBM PC. Apple, or CPM
ISpecofy Computer) Dnvor Progrom on Dose
Programs the foliowong 5 Volt 24 or 28 pm
dovocos 2716 tlvougll 27512. 25u ·
68764 plus others. P1eaH Specofy Personlloty
Modulo de5Kod woth order Addotoanol Personlloty
Modules only $15 00 ea F.. 1 , _ w - ty.
TO ORDER CAll 1 8001962-&800 OR WRJTE
-~
APR:OTE.Jt.
,.., 71 A
AVl~IOA
ACASO
t AMARILLO (A 9;J0
lqt,,
\.\ot
AO'l 9t3 7
1 (1
)J~.l
A( • 11 G .,,
Atl d
'i4 00 Sh•ppony ll!:JA
VISA
01
MC Add J
Sr h •nl I'. L.uy"' ( 01p P 0..,
Inquiry 23
9-TRACK MAG. TAPE SUBSYSTEM
FOR
PC/XT/AT
......
•42 Mlytet on I lingle
• liM lonNol 1100 cpl
• Sonware tor PC.OOS,
MS-DOI.
II' '- p/'toltffot "'WX
11:14:1
111.1 COMII'U'Tl" COflll
Xl741 ........ $t
C~CAttJn
11\11
·TWJ' ·
tfO<IG-~71
b.n~,IC)tt
Inquiry 135
64K•12BK•256K
DRAMS
Listing 2b A -amplt•
11111
Program generates factoria l sum sequences.
Lower I imit, upper I imit ? 24, 27
24 26 722 5044 169 363601 1454
25 122 5 120 4 24
169 * loops to step 9
26
722
5044
27 5042 147
to step 5
Ok
26
169
363601
5065
961
722
1454
363601
5044
169
* loops to step
169
363601
169
363601
BITTNER
3E:
1454
169 * loops to step
1454
4
80287-8. 80287-3
8087-3. 8087-2
8087-1
ELECTRONICS
3
* loops
899 SOUTH COAST HIGHWAY
LAGUNA BEACH, CA 92651
(7141 497-6200
CALL NOW FOR FREE CATALOG
Inquiry 40
-- -
-.
......
DATA SWITCHES
SHAR E computers . printet'l
any parallel or Mrial drnc:e
_.._
-
---..~ .....
NUMBER GAMES
ELI MINATE cebte IWtpOti\Q
I N EXPEN~IVE wa 'f to netwoA
...:o.II--AI
COMPATIBLE With
att~ puters
Buttnessa, Schools, Homes
WE ALSO OFF ER
..~:;:::::...-.---. Data Bufftfl . line Dnvera,
-PrococoiCon-
....
Parallet • S.naJ Con\Wtera
Cablft, Con\pull<l. Pnn- .
Otslit On't81, anct more
AUTOMATIC • CAAETAMEJII 11 IONI for 1 bus$nea Of'
tehool to ahara a pr•nter or modem among rnan'f eomputera
Listing 3a: Tfte BASIC pro~ram to /illd palindromrs by addim1 a •wmt•cr to its
reverse rmage <llld repeatinq lire rr,JCt'SS 1dlll tltc restiltilly sum
Operataon 11 tutty automat.c w, tft no software required
Para'tef Of S.nal 4 t:hartnell • 1NS 8 chan~ a • $31'5
MANUAL • HUOIWITCH 11 operated Wtlh the 11•P of I
sw,tc.h 2 2 and 2 4 models anow ••muftt neous commun.
""''"'"
Sonol
Patllol
I 2 S59
I 2 • $111
14 S 119
I • $1J9
LE O and JC>•ka protactton on
2 2 SIOII
2 2 $119
Mr~<~J ~laldd
24 • Slll8
2 • · Slll8
120
CODE ACTIVA TED · POATEJt connects one computer to
m ulllpte ~t pfwrais A 10hwaraeocteseJet.1 thepet•pheral
Parallel or Set... • channels · $295 1 ehlr'lnels - 1305
Buffer ophon 04K • $100
258K S250
REMOTE • TELE,ATH connects muft•pte ~pulerS to
muH•plepenpherals A MI«t.OJ t ltachcomputaror termNI
choosea up to 4 penpheraJs and d•sptays busy alltus
. __ ---
u • S•ll5 . . · 1795 aeloclor · 139
~=--,....~e_
ROSE ELECTRONICS
(713) 933·7673
P 0. 101 JC2571
11C I VISA~
HOUSTON. Tl m74
ONIH ........ ._...
CAll US FOR All YOUR INT£11FAC£ N£EOS
Inquiry 254
DATA ACQUISITION TO GO
INTERFACE FOR ANY COMPUTER
FREE IBM SOFTWARE
Connects via RS-232. Fully IBM compatible. Built-in BASIC. Stand alone
capability. Expandable. Battery
Option. Basic system: 16 ch 12 bit
AID, 2 ch. D/A, 32 bit D1gital 1/0.
Expansion boards available. Direct
Bus units for many computers.
(201) 299-1615
P.O. Box 246, Morris Plains, NJ 07950
ELEXOR
Inq uiry 103
Get the whole
stoey on graphics
terminal emUlation.
1b find out more about software
that lets your PC emulate
TEKTRONIX'" 4105/6/7/9 and
DEC VTlOO'" termmals,
call or write:
GRAr-POinT
4l40Stncna ri"'CktBivd Su itc2.,
Sa n lao<, CA 95129 /oiCIII 2A9·19Sl '
10 REM Palindromic Sums
20 REM by Bob Kurosoko
30 REM ------------ ----- --------------- - - - ----------- ----- -40 SP$=" "
:REM One spa ce i nside quotes
50 D$="0123456789"
60 YES•( 1=1)
: REM A( ) holds the d i g i ts.
70 DIM A(100)
80 CLS
90 PRINT"Progrom generates sequen ces ending in palindromes ."
100 PRINT
110 PRINT "Lower I im i t (>10 ) and up per I i mit ";
120 INPUT LL, UL
130 LL•ABS(INT(LL))
140 UL•ABS(INT(UL))
150 IF LL<10 THEN 110
160 FOR N=LL TO UL
170 SP•0
:REM SP cou nts th e s teps before a cyc l e
180 REM ------- ------------ --- - -------- ----------- ---------190 REM Break up the ter m int o its component digits
200 M=N
:REM Make a copy of latest t erm
210 0=1
:REM D = no. of d igits
220 T•INT(M/10)
: REM T = no. of "Te ns" in M
230 A(D)•M- 10• T
: REM Sto re rightmost d i git in array A
240 IF T<>0 THEN 0=0+1: M=T: GOTO 220
250 ODD•ABS((INT(D/2)<>0/2)) : REM Eve n or odd no . of dig i t s?
260 REM --- ----- ----- - - ------------------------------------270 REM Pr i nt the latest t er m
280 FOR I=U TO 1 STEP - 1
290 PRINT MI0$(0$ , A(l)+1 , 1);
300 NEXT I
310 PRINT SP$;
320 REM - ----------- ---- - ---- --- --- - - ------------------- - --330 REM Check for palindrome
340 FOR I•1 TO 0/2
350 PL•(A(I) =A(0-I+1))
360 IF NOT PL THEN I=0/2 : REM Exit i f no t a po l i ndrome
370 NEXT I
380 IF PL THEN 580
390 REM -------- --------------------------------- ---- ------400 REM Add each digit to its reve r s e image counterpar t
410 FOR I• 1 TO 0/2+000
420 A(I)=A( I )+A(0-1+1)
430 A(D-I+1)=A(I)
440 NEXT I
450 REM Ch~ck for corry
460 FOR 1•1 TO D
470 IF A(I)<10 THEN 500
480 A(I)•A(I)-10
490 A(I+1)=A(I+1)+1
500 NEXT I
510 IF A(D+1)=0 THEN 540
s20 o.. D+1
530 OOO=ABS((INT(0/2)<>0/ 2))
540 SP•SP+1
550 GOTO 280
560 REM ------ ------ -------------- ---------- - ------------ - - 570 REM Indicate that a cyc le ha s been found
580 PRINT "* at step " ; SP
590 FOR 1=1 TO 0
600 A(I) .. a
610 NEXT I
620 NEXT N
630 END
NUMBER GAMES
Li ting 3b. A samplt•
lUll.
.... ...::::-u.·:.c:
Program generates sequences ending in pol indromes.
·=-~---=:.-:::e
. . . . . . . . . CM&eiiK . . . .,......e ... ecelltt W0 1010011110ftQ
=--.-y~....:.:-~,."'*' · ~Hall
Lower limit (>10) ond upper I imit? 75, 80
..
....
•,_.AID....,..1501C~- IIIII . Iilvdlflier..... ~
~--· . . . snt~ . . . . . . . . . . . . ........
&c:-.Uit fFT...,.....
. _ . . _ , ,. . NO
75 132 363 • ot
76 143 484 • ot
77 • ot step 0
78 165 726 1353
79 176 847 1595
80 88 * ot step
step
step
..,.....,...,Iflll...,. ant
•........,...., ....... H.....,.,._.,._.._ 24 ... WO...,....• Cloll ....... ....,...,_,
....,,
.......
. .......
.,_, ......,............
.....,....,Oft_,....,_
.....
l tl
2
2
4884 • ot step 4
7546 14003 44044 * ot step
1
•tiMAID ......
1Dwr~1CIK
~
.....
~
ltV81~......,,
,,....,~
....... ............ ..
• _..,.. ........ c... ........ Faroe...,_. ...... ...,
6
~~·
.,~.._..c.IIIH
... C..C
~
. c.;..,,...
~~:.:.::::~ · -:..'""i:::i:L:.'='
.. ., .........
~
•ua.,....... • ....,..,....., ...... ,.....
..,JIC
m
Ok
Listmg 4a: Tlie BASIC program to perform the delete-a11d-add routi11e for any
mtcqra/
r (l\tt'r
10 REM Delete ond Add
20 REM by Bob Kurosoko
30 REM ----------------------------------------------------40 N•50
:REM N~number of integers in starting sequence.
50 DIM SF$(3), A(N) :REM SF$() = suffixes, A() =sequence.
60 DATA nd, rd, th
70 FOR Ja1 TO 3: READ SF$(J): NEXT J
80 REM ----------------------------------------------------90 CLS
100 PRINT "Program uses o delete-and-odd process"
110 PRINT "to generate iAp for i=1 to ";N; "/ p."
120 PRINT: INPUT "Enter o value for p (power)"; P
130 PsABS(INT(P))
140 IF P<2 THEN 100
150 REM ---------------- ------------------------------------160 PRINT: PRINT "Starting sequence:"
170 fOR I•1 TO N
180 A(I)•I
190 PRINT I;
200 NEXT I
210 PRINT
220 REM ---------------------------- ------------------------230 FOR R=P TO 2 STEP-1
240 DC=0
:REM Counts the terms deleted.
250 FOR J=R TO N STEP R :REM Delete every Jth term
260 A(J)=0
270 DC•DC+1
280 NEXT J
290 REM ----------------------------------------------------300 REM Print deleted orroy
310 WSF=SGN(R-3)+2
:REM Select suffix
320 PRINT: PRINT "Delete every "; R; SF$(WSF); " term:"
330 FOR I=1 TO N
340 IF A(I)<>0 THEN PRINT A(l); ELSE PRINT "•";
350 NEXT I
360 REM ----------------------------------------------------370 REM Compute Portio! Sums
380 Ka1
390 FOR J=2 TO N-DC :REM There wi I I be N-OC valid numbers.
400 K•K+1
:REM K points to next term to be added.
410 IF A(K )=0 THEN K=K+1
:REM Skip zero (deleted) terms.
420 A(J)=A (J-1)+A(K) :REM Calculate portio! sum.
430 NEXT J
440 N=N-DC
:REM Revise the number of vali d terms in A().
450 REM ------------------------------------------------- ---460 REM Print Portio! Sums
470 PRINT: PRINT: PRINT "Portio! sums:"
!CO II !HIUtd)
6809
Single Board Computer
Inquiry 118
9-Track Tape Subsystem
Now you can uchang data files between
your IBM l'C XT I AT and any mamframeor
minicomputrr u'ilng IBM compatible 1600 BPI
9-Track tape . Unot can also be used ford1~k
backup and archival storilboe. Transfer r~te
is one megabyte per mmute on PCs and 100'"
compatibles. Su~y-.tems include 'Tor 10 1 ,, .
strea~~n~ tape drive, tape coup. ler card
and DOS compatible software
Pri !>tart at $3.555.
OLJRLSTRR,.
'lOIS EtonAve. C noga Park, CA en~
Telephone (818) 882-5822
Inquiry 246
NUMBER GAMES
480
490
500
510
520
530
The delete-and-add
process produces
a power sequence.
FOR 1•1 TO N
PRINT A(l);
NEXT I
PRINT
NEXT R
END
every fourth term and list the partral
urn of the remaining terms (5e
frgure I for an explanatronl
O\\
delete every thrrd term and agam ~~~
th partral sums Then del 't • ·v ·ry
second term and list the partral sums
one last time.
We stop at this pomt (we wouldn t
delete evern term would we?l and n e
the remarkable results The equence
consrsts of the fourth powers of the
whole numbers
This procedure generalizes to nth
powers (begin by deleting every nth
term. and st on I It was drscovered by
Alfred Moessner m 1951 and prov ·d
by Oskar Perron in the same year A
thorough treatment can be found m
.. On the Moessner Theorem on Integral Powers.. by C T. Long 111 the
American Matfremalit 1/ 1ontfJ/u . vol 71
( 1966) pages 846-8 51
Listing 4 performs the above dele
and-add routine for any integral
power For larger powers. the mitral list
of vhole numbers should be xtended in lme 40. (Hint: For the nth
power. only I nth of the lis will remain
to the conclusron ) For very large
powers. the use of ext<.;nded or double precisron may be in order.
I hope you find these proccdure'i
and their results as en1oyable as I do
I would welcome any references and
sources on these or other number
sequences. •
Listing 4b: A sample run.
Program uses o delete-and-odd proces s
to generate 1•p for 1•1 to 50 I p.
Enter o value for p (power)? 4
Starting sequence :
1 2 3 4 5 6 7 8 9 10
18 19 20 21 22 23 24 25
33 34 35 36 37 38 39 40
48 49 50
Delete every
1 2 3 • 5
21 22 23 •
39 • 41 42
11
26
41
12
27
42
13
28
43
14
29
44
15
30
45
16
31
46
17
32
47
4 th term:
6 7 • 9 10 11 • 13 14 15 • 17 18 19 •
25 26 27 • 29 30 31 • 33 34 35 • 37 38
43 • 45 46 47 • 49 50
Partia l sums:
1 3 6 11 17 24 33 43
171 193 216 241 267 294
523 561 600 641 683 726
54 67 81 96 113 131 150
323 353 384 41 7 45 1 486
771 817 864 913 963
Delete every 3 rd term:
1 3. 11 17. 33 43. 67 81 • 113 131 • 17 1 193. 24 1
267 • 323 353 • 417 451 • 523 561 • 64 1 683 • 77 1 817
• 913 963
Partial sums:
1 4 1s 32 65 108
1372 1695 2048 2465
6912 7825 8788
175 256 369 see 671 864
2g16 3439 4000 4641 5324
11 e5
6095
Delet e every 2 nd term:
1 • 15. 65. 175. 369 . 671 • 1105 . 1695. 2465 . 3439 .
4641 • 6095 • 7825 •
Partial sums :
1 16 81 256
20736 28561
625
1296
2401
4096
656 1
10000
14641
Ok
Senes with fNery fourth
term deleted
New senes composed
of partial sums
1
+...-/12
1/ +3/
+../'13
. +6/
+~5
tl/
+~6
1+7/
+
~7
2.4/
+
~9
...
3t3
Figure I : In the delete-and-add program. partial sums are taken to produce a new sequence of terms Tfte {trst term is unchanged
The second term is added to the first term to produce a new second term. Tftat new term rs added to the third term to produce a new
third term. and so forth.
lJI
BY TE • AUGUST 1986
© Copyright 2026 Paperzz