After some searching, I could not find a previous TI-BASIC golf challenge in this fashion.

Write the smallest TI-BASIC program that generates the first 999 primes and puts them in a list, either in Ans or in a list variable.

No external data allowed, or pre-loading variables or lists outside of the program.

Score is size-on-calc - 9 - length of program name, as normal.

Leaderboard:
    calc84maniac: 25 bytes
    NoahK: 27 bytes



Here is my submission:
NoahK wrote:
{2
For(A,3,|E4
If not(sum(not(fPart(A/Ans
augment(Ans,{A
End
As discussed in chat, there's not too much room for size improvement on a problem this simple, but at least I can trim down the if statement a bit for a 25-byte solution:

calc84maniac wrote:
{2
For(A,3,|E4
If min(fPart(A/Ans
augment(Ans,{A
End
I think that calc84maniac's solution is the smallest possible; I could probably get it faster, though, if not smaller.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement